Diaz-Canel, leader of the Communist Party - the countries only recognized political movement - won a landslide vote of 97.66% of the National Assembly, all of whose 470 members are aligned with the party or sympathetic to it.
The newly elected president, in a televised speech, thanked cheering lawmakers for their support and pledged to control inflation.
Among the crowd was Raul Castro, 91, the late Fidel's brother, who vigorously shook Diaz-Canel's hand upon announcement of the results, showing the old guard's continued support.
The assembly also re-elected Salvador Valdes as Cuba's vice president and Manuel Marrero as prime minister.
The rejoicing is likely to be short-lived as Diaz-Canel's incoming administration faces daunting challenges during his next five-year term.
Inflation has soared and tourism has floundered since the coronavirus pandemic, and long lines for fuel, medicine and food have raised tensions, fanning unrest that led to the largest protests in decades in July 2021.
Hundreds of thousands have migrated off the Caribbean island in the past year, fleeing economic ruin.
Cubans are deeply divided over Diaz-Canel's reelection. Some said the Cuban leader is a sign of 'revolutionary firmness.' Others rejected his re-election due to the economic crisis the Caribbean island is going through.
Diaz-Canel's administration will be quickly put to the test as the government seeks to placate the public amid growing shortages and wades into thorny issues, including the regulation of the press and the right to protest.
Candidates for president and legislative leaders were proposed by lawmakers before Wednesday's session and then vetted by a National Candidacy Commission before a vote of the full legislature.
Reuters