From Iran's Mahmoud Ahmadinejad to Cuba's Raul Castro, about 30 heads of state joined today's funeral of Hugo Chávez in a last goodbye to the charismatic but divisive Venezuelan leader who changed the face of politics in South America.
Mr Chávez died on Tuesday at age 58 after a two-year battle with cancer, devastating millions of mostly poor supporters who loved him for putting the country's vast oil wealth at their service, but also giving hope to foes who saw him as a dictator.
The country's supreme court said today vice president Nicolas Maduro became acting president the moment Chávez died, and can run for president.
The decision comes just hours before Mr Maduro is to be sworn in as acting president before the national assembly and it was issued during the state funeral for Chávez.
National assembly speaker Diosdado Cabello had earlier announced the planned swearing-in, which the opposition says it is boycotting. In a tweet, opposition leader Henrique Capriles called today's court ruling "a constitutional fraud".
The constitution specifies that the national assembly speaker should have become interim president as Chávez was never able to assume office before he died. Chávez, who was re-elected on October 7th but never sworn in, anointed Mr Maduro his successor.
Huge crowds of "Chávistas" arrived earlier for the ceremony at a military academy where his body has been lying in state. Many were dressed in the red of the ruling socialist party, carrying his picture and waving Venezuelan flags.
"Chávez did not die, he multiplied!" they chanted. "Chávez lives! The revolution goes on!" The late president's body is to be embalmed and shown "for eternity" at a military museum - similar to how communist leaders Lenin, Stalin and Mao were treated after their deaths.
His remains will lie in state for an extra seven days to accommodate the millions of Venezuelans who still want to pay their last respects to a man who will be remembered as one of the world's most colourful and controversial populist leaders.
"All these measures are being taken so that the people can be with their leader forever," said Mr Maduro.
More than two million people have so far filed past Mr Chávez's coffin behind a red rope at the grandiose military academy, many sobbing, some saluting or crossing themselves.
Among the leaders gathering in Caracas were close allies such as Ecuadorean president Rafael Correa, Brazil's current and former leaders, Dilma Rousseff and Luiz Inacio Lula da Silva, and Cuban president Raul Castro.
"Most importantly, he left undefeated," Mr Castro said, referring to Mr Chávez's four presidential election wins and a string of other ballot victories in his 14-year rule.
"He was invincible. He left victorious and no one can take that away. It is fixed in history."
Belarusian president Alexander Lukashenko and Mr Ahmadinejad were among the more controversial figures scheduled to attend the ceremony.
The United States, with whom Mr Chávez had a rocky relationship, was not sending high level officials. Former US representative William Delahunt, US representative Gregory Meeks, and the charge d'affaires from the US embassy will attend, amid speculation of a possible post-Chávez rapprochement between Caracas and Washington.
"The show of love for the president has been incredible," said foreign minister Elias Jaua.
A government source said Mr Chávez slipped into a coma on Monday before dying the following day of respiratory failure. The cancer had spread to his lungs, the source added.
Mr Chávez never said what type of cancer he was suffering, and for reasons of privacy had chosen to be treated mainly in Cuba.
His death paved the way for a new vote in the South American nation that boasts the world's biggest oil reserves. But it is unclear when the election will be held. Many Venezuelans have yet to get past his death and have not thought much about the future.
"For me, Chávez was more of a father than a leader," said social worker Anibal Arciniegas (26), adding he had arrived at midnight to take his place for the funeral. "He made us visible. Before him, governments discriminated against the poor."
At the gates of the academy, activists handed out photos of Mr Chávez along with printed quotes of his call for supporters to vote for Mr Maduro should anything happen to him.
The constitution stipulates that an election must be called within 30 days, but politicians say the electoral authorities may not be ready and there has been talk of a possible delay.
Mr Maduro (50), a former bus driver who became foreign minister and then vice-president, looks certain to face opposition leader Mr Capriles, (40) the centrist governor of Miranda state, who lost to Mr Chávez in last October's election.
Opposition sources say the 30 or so political groupings making up the Democratic Unity coalition have again agreed to back Mr Capriles, whose 44 per cent vote share in 2012 was the best performance by any candidate against Mr Chávez.
Opposition loyalists blame the late president for creating deep rifts in society with his combative, hectoring style.
"He did more damage to Venezuela than anyone else," said one opposition supporter, Cesar Caballero (66). "The country is broken in two parts, each hates the other. Chavez did that."
A recent opinion poll gave Mr Maduro a strong lead over Mr Capriles, and western investors and foreign diplomats are factoring in a probable win for Mr Maduro and a continuation of "Chávista" policies, at least in the short term.
Mr Maduro, who lacks Mr Chávez's man-of-the-people charisma, has pledged to adhere to his late leader's brand of nationalist politics and leftist economic policies.
Reuters