Miguel Diaz-Canel has been officially named Cuba's new president.
The 86-year-old Castro will remain head of the Communist Party, designated by the constitution as "the superior guiding force of society and the state".
Díaz-Canel had been serving as first vice-president for the past five years.
And he noted he would have Raul Castro as a guide - a nod to those veterans of the revolution with concerns that their socialist legacy may be buried by the tide of reform.
Speaking after Diaz-Canel, Castro said he expected the younger man to become first secretary of the party after Castro retires from the position in 2021.
Of the 604 lawmakers present, 603 voted in favour of making Diaz-Canel president and unanimously for the other mainly middle-aged members of the state council, marking a generational shift from the elderly leaders who fought to topple US -backed dictator Fulgencio Batista in 1959.
Raul Castro says he sees new Cuban President Miguel Diaz-Canel as his eventual successor as head of the island's powerful Communist Party. He said there would be no compromise in Cuba's foreign policy but in a repetition of a long-held stance by Havana, he said he would hold dialogue with anybody who treated Cuba as an equal. "Cuba needs him, providing ideas and proposals for the revolutionary cause, orienting and alerting us about any error or deficiency, teaching us, and always ready to confront imperialism".
Raul Castro's retirement from the presidency of Cuba has its own theme song.
Diaz-Canel inherits a youthful population hungry for change. People there describe him as a hard-working, modest-living technocrat dedicated to improving public services.
In a video of a Communist Party meeting that inexplicably leaked to the public a year ago, Diaz-Canel expressed a series of orthodox positions that included somberly pledging to shutter some independent media and labeling some European embassies as outposts of foreign subversion. Worldwide observers and Cubans alike will be scrutinizing 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 subsidised 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.
The new leader will be tasked with pursuing reforms begun by Castro to open up Cuba's economy to small private entrepreneurs and reach a rapprochement with its Cold War arch-enemy, the United States. They all received 100 or 99.83 percent of the votes.
The assembly also approved another six vice presidents of the Council of State, Cuba's highest government body.
The party selected six vice presidents, only one of whom, Ramiro Valdes Menendez, 85, fought in the revolution.