As Diaz-Canel walked to the front of the chamber, he high-fived the front row of delegates and embraced Castro as he took the stage, images broadcast on state television showed.
San José, 19 April (Prensa Latina) Costa Rica mass media highlighted Thursday the election of Miguel Diaz-Canel as president of Cuba, during the inaugural session of the 9th Legislature of the National Assembly.
Díaz-Canel had been serving as first vice-president for the past five years.
Castro was originally set to retire February 24 this year, but the country was still dealing with the aftermath of Hurricane Irma, so his succession was postponed.
Castro is making his first speech since handing the presidency over to Diaz-Canel, and used the opportunity to give his vision of the future.
The 86-year-old Castro will remain head of the Communist Party, which is designated by the constitution as "the superior guiding force of society and the state". "In support of this, our stated policy to channel funds toward the Cuban people and away from Cuba's military, security and intelligence services is not expected to change".
As Castro got up from the seat he has occupied for the past 12 years, it was immediately taken by Diaz-Canel, a man almost 30 years his junior who has spent years climbing the party ranks. The President will still have to answer to Castro, who will remain head of the Communist Party.
Six dead in Iran armed clash near Pakistan border
Iran is expected to deploy the weapon to warzones in the region to combat what Iranian officials described as "regional threats". The Guards also have authorization to launch several long-range missiles that can be fired from Iran at targets in Israel.
Most Cubans know their first vice president as an uncharismatic figure who until recently maintained a public profile so low it was virtually nonexistent.
Mr Diaz-Canel gained prominence in central Villa Clara province as the top Communist Party official, a post equivalent to governor.
In a video of a Communist Party meeting that inexplicably leaked to the public previous year, Mr Diaz-Canel expressed a series of orthodox positions that included sombrely pledging to shut some independent media and labelling some European embassies as outposts of foreign subversion.
Worldwide observers and Cubans alike will be scrutinising every move he makes after he officially takes office on Thursday.
Raul Castro served as president for two terms since 2008. He has failed to fix the generally unproductive and highly subsidized state-run businesses that, along with a Soviet-model bureaucracy, employ three of every four Cubans. Today, more than two-thirds of Cubans work in the inefficient state sector, earning on average of US$30 a month. They all received 100 or 99.83 percent of the votes.
The results of the deputies of the elected State Council were also announced in the event. Only one, 85-year-old Ramiro Valdez, was among the revolutionaries who fought with the Castros in the late 1950s in the eastern Sierra Maestra mountains.