CARACAS, Venezuela -- Foreign dignitaries and Venezuelans continued their extended goodbye to Hugo Chávez on Friday as the government conducted a stately funeral that seemed designed to showcase Mr. Chávez's appeal to the powerless and the powerful.
The funeral was a stunning display of the political alliances that Mr. Chávez assembled during almost a decade and a half in power, with some of the leaders in attendance, including those notable for having a history of difficult relations with Washington, making their presence here felt.
At one point, Iran's president, Mahmoud Ahmadinejad, kissed the coffin, mustering a clenched fist after doing so. Aleksandr G. Lukashenko, the president of Belarus, shed some tears.
While leaders from an array of countries in Latin America and the Caribbean attended the funeral (along with Prince Felipe of Spain), some were notably absent from the politicized ceremony, in which Vice President Nicolás Maduro placed a replica of a golden sword on Mr. Chávez's casket to much applause.
Brazil's president, Dilma Rousseff, and her predecessor, Luiz Inácio Lula da Silva, did not attend the funeral, after paying their respects here earlier in the week.
Outside the military academy where Mr. Chávez lay in state, thousands of people stood in long lines with a mixture of weariness and giddiness: many had waited for as long as 24 hours and still were not close to entering the hall where they would have a chance to file past the president's body in its glass-covered coffin.
As the dignitaries began to arrive Friday morning through a side entrance, to walk down a red carpet, the lines outside stopped moving. An announcement over a loudspeaker pleaded for patience.
The crowd outside cheered when Mr. Chávez's mother, Elena, arrived and she waved to them.
"I've been here since yesterday, and to tell you the truth, I don't feel tired," said Genesis Briceño, 22, an economics student, who had been waiting since early Thursday morning. "I want to see him."
Ms. Briceño was elated by a government announcement that Mr. Chávez's body would be embalmed and displayed "eternally" in a glass case in a new Museum of the Revolution.
"We will have him in there forever," she said. "We all will be able to see him."
The V.I.P. guest list included leftist Latin American presidents like Raúl Castro of Cuba, Evo Morales of Bolivia, Rafael Correa of Ecuador and Daniel Ortega of Nicaragua, who were among Mr. Chávez's closest allies.
The United States, which was often on the receiving end of Mr. Chávez's anti-imperialist diatribes, despite being the principal buyer of Venezuelan oil, said that it would send a delegation of Representative Gregory W. Meeks, Democrat of New York, and former Representative William Delahunt, Democrat of Massachusetts.
Mr. Chávez, 58, died on Tuesday after a battle with cancer. His body was taken from the military hospital where he died to the military academy on Wednesday. The lines formed then to file past the glass-covered coffin where the leader lay, wearing a red beret and a green military uniform.
Mr. Maduro, Mr. Chávez's handpicked successor, said on Thursday that Mr. Chávez's body would remain on display for at least seven additional days before it was removed and embalmed for posterity.
Officials said that Mr. Maduro would be sworn in as interim president on Friday evening, although some in the political opposition said that the Constitution designates that the interim post should go to the head of the National Assembly, who is also a close Chávez ally.
Officials have said they will follow the constitutional requirement that new elections be held to replace Mr. Chávez. The Constitution says the nation should proceed to a new election within 30 days, but so far no timetable has been announced.
Mr. Maduro will run as the government candidate. His opponent is expected to be Henrique Capriles Radonski, an opposition leader.
Mr. Chávez used his country's vast oil wealth to carry out what he called a Bolivarian revolution, named after the indepence-era hero Simón Bolívar, based on Socialist principles and held together by his personal charisma. Venezuela has the world's largest estimated petroleum reserves and is the fourth-largest foreign oil supplier to the United States.
Simon Romero contributed reporting.world
This article originally appeared in The New York Times.