Saluting, clenching fists and making the sign of the cross over Hugo Chavez's casket, Venezuelans have gathered in Caracas to see their deceased leader one last time.

They pledged that his socialist revolution would not die.

Grieving supporters lined around a grandiose military academy in a mass show of devotion to Mr Chavez, who died on Tuesday at age 58 after a two-year battle with cancer.

More than 2 million people have already paid their respects.

From soldiers in fatigues to officers in ceremonial dress, senior ministers to residents of the slums where Chavez was most loved, those in line vowed to defend his legacy and back his preferred heir, acting President Nicolas Maduro, in a new vote.

"We want to see the president, we want to be there for his last moments," said Trinidad Nunez, 40, outside the building where Chavez's body will lie in state until a funeral on Friday.

"It is up to us to carry on the revolution and do what Chavez asked us to do: support Maduro."

Mr Chavez was dressed in an army uniform and a signature red beret like the one he wore in a 1992 speech to the nation that launched his political career after he led a failed coup.

People were given just a few seconds to glance at Mr Chavez's body inside the relatively simple wooden coffin, with a glass top and draped in flowers and a Venezuelan flag.

One government source said Mr Chavez slipped into a coma on Monday and died the next day of respiratory failure after a rapid deterioration from the weekend, when he had held a five-hour meeting with ministers at his bedside.

The cancer had spread to his lungs, the source added.

There is uncertainty over exactly when a presidential vote will be held in the South American OPEC country with the world's largest oil reserves and 29 million residents.

Though the constitution stipulates a poll must be held within 30 days, politicians say election authorities may not be ready in time and there is talk of a possible delay.

Mr Chavez ruled for 14 years, winning four presidential elections.

Mr Maduro, 50, a former union leader who ended his education at high school before plunging into politics, looks certain to face opposition leader Henrique Capriles, 40, the centrist governor of Miranda state who lost to Mr Chavez in last year's election.

Opposition condolences

Members of the opposition have kept a low profile and offered condolences during the enormous show of support for one of Latin America's most popular leaders.

But some expressed relief at the demise of a man they viewed as a dictator who trampled on opponents and ruined their economy.

"I wanted his mandate to end. Power made him lose perspective," said Israel Nogales, 43, a university administrator in a Caracas park.

"He polarised the country and families like mine. ... He is going to be treated like a martyr and that is wrong."

Opposition sources have said they will back Mr Capriles again after his 44% vote share in 2012 was the best performance by any candidate against Mr Chavez.