Hugo Chavez was known to break out into song during his long-winding speeches, and fittingly, traditional Venezuelan llanera music filled the space where his funeral was held.
Chavez, who died Tuesday at age 58, was a polarizing figure in his country. But his followers revered him, and his funeral Friday in Caracas reflected that status.
There were 32 heads of state in attendance, and all of them were called, in groups of eight, to flank the Venezuelan president's casket and observe a moment of silence as honor guards.
Venezuelan standouts in the arts and sports likewise surrounded the deceased leader.
Chavez left behind a mixed legacy: He is credited with putting the nation's poor at the center of his policies, but also had an authoritarian streak that garnered criticism from defenders of human rights and press freedom.
The turnout of foreign leaders and thousands of mourners who waited hours for a chance to view Chavez is a testament to the role he played in the country, the Rev. Mario Moronta said.
Venezuelan Vice President Nicolas Maduro, who will be sworn in as interim president later Friday, laid a replica of the sword that South American hero Simon Bolivar used on top of Chavez's flag-draped casket.
Tributes to Chavez were also paid in Cuba, where the military made a 21-gun salute from the La Cabana Fortress overlooking Havana. Military officers placed roses in front of a picture of Chavez. Venezuela and Cuba maintain close military ties, and Cuba sent hundreds of military and intelligence advisers to aid Chavez while he was president.
Chavez was known for his anti-American rhetoric and allied himself with others at odds with the United States.
Iranian President Mahmoud Ahmadinejad attended and kissed Chavez's casket.