Venezuala's President Hugo Chavez gesturing as he sits next to Vice President Nicolas Maduro during a televised radio event in Caracas. (AFP/Presidencia)

The flag-draped coffin of Venezuelan leader Hugo Chavez was borne through throngs of weeping supporters on Wednesday as a nation bade farewell to the firebrand leftist who led them for 14 years.

His mother Elena wept over his wooden casket as a band played the national anthem outside his military hospital. Presidential guards with red berets then placed his remains on top of a black hearse, surrounded by flowers.

Chavez' death after a two-year struggle with cancer was a blow to his adoring supporters and the alliance of left-wing Latin American powers, and plunged his oil-rich country into uncertainty as an election is organized.

His body, surrounded by soldiers, was being taken to the military academy that the former paratrooper colonel once called a second home, where he will lie in state until an official ceremony with foreign dignitaries on Friday.

Venezuela's President and presidential candidate Hugo Chavez speaks in the rain during his closing campaign rally in Caracas on October 4, 2012. (Reuters/files)

People watched from their apartment windows, others climbed fences to get a better view of the hearse, many held or wore iconic images of Chavez.

The 58-year-old leader succumbed to a respiratory infection on Tuesday. A new election is due to be called within what are sure to be 30 tense days.Key events in Hugo Chavez's life

Vice President Nicolas Maduro, who tearfully broke the news to the nation that his mentor had lost his battle with cancer, was poised to take over as interim president and campaign as Chavez's chosen successor.

The death brought thousands of Venezuelans to public squares across the nation, weeping and celebrating the life of a divisive figure whose oil-funded socialist revolution delighted the poor and infuriated the wealthy.

Hundreds of people spent the night in front of his hospital, waving Venezuelan flags and chanting "we are all Chavez!" A banner was hung the hospital fence, reading "Chavez lives, the battle continues!"

Supporters of Venezuelan President Hugo Chavez wave a huge national flag outside the Military Hospital in Caracas. (AFP)

"I love him," said Iris Dicuro, 62, who came from the northeastern city of Puerto La Cruz and wore a shirt with the words "Forward Comandante." "I want to bid farewell because he was a good man who gave everything to the poor." Cuba ponders future after Chavez's death

The armed forces were to fire a 21-gun salute and "there will be a salvo every hour until his burial," Defense Minister Diego Molero said.

Some of Chavez's closest allies had already arrived Wednesday ahead of the state funeral, including Argentina's President Cristina Kirchner, Uruguay's Jose Mujica and Bolivia's Evo Morales.

Maduro said The nation's security forces had been deployed but Foreign Minister Elias Jaua said calm reigned in Venezuela, which was rocked by a short-lived coup against Chavez in 2002.

Venezuela's closest ally, communist Cuba, declared its own mourning period for a leader who helped prop up the island's economy with cheap fuel and cash transfers, and dubbed Chavez a "true son" of revolutionary icon Fidel Castro.

But US President Barack Obama -- often a target of Chavez's anti-American scorn -- was circumspect, pledging the United States would support the "Venezuelan people" and describing Chavez's passing as a "challenging time." Hugo Chavez's inner circle

Shortly before Chavez's death was announced, Maduro expelled two US military attaches and accused Venezuela's enemies of somehow afflicting the leftist with the cancer that eventually killed him.

Chavez was showered with tributes from Latin American leaders and Russia, China and Iran also paid tribute to a man who had cultivated close ties with the bugbears of the West as a way of thumbing his nose at Washington.

Iranian President Mahmoud Ahmadinejad said Chavez had fallen "martyr" to a "suspect illness," while hailing his close ally for "serving the people of Venezuela and defending human and revolutionary values."

Chavez had checked into the hospital on February 18 for a course of chemotherapy after spending two months in Cuba, where in December he had undergone his fourth round of cancer surgery since June 2011.

Cuban President Fidel Castro introduces on December 14, 1994 former Venezuelan officer Hugo Chavez to University of Havana students as Mario Vela (R), the rector of the University, listens. (AFP)

The once ubiquitous presence on state television and radio disappeared from public view after he was flown to Cuba on December 10, an unprecedented absence that fueled wave after wave of rumors.Devastated Chavez's supporters pour into streets

A new election could offer another shot at the presidency to Henrique Capriles, the opposition leader who lost to Chavez in October but insisted Tuesday that the two men were "adversaries, but never enemies."

Luis Vicente Leon, director of the polling group Datanalisis, said the government will likely want to hold elections as early as possible "to take advantage electorally of the emotion generated by the president's death."

Chavez will be mourned by many of the country's once-neglected poor, who revered the self-styled revolutionary for using the country's oil riches to fund popular housing, health, food and education programs.

Venezuelan President Hugo Chavez hugging members of his family during the birthday celebration for his daughter Maria Gabriela (not in frame) in Havana. (AFP)

And like-minded Latin American leaders like Cuba's Raul Castro, Ecuador's Rafael Correa and Bolivia's Morales lost a close friend who used his diplomatic muscle and cheap oil to shore up their rule.

Chavez died five months after winning re-election, overcoming public frustration over a rising murder rate, regular blackouts and soaring inflation.

The opposition had accused Chavez of misusing public funds for his campaign and dominating the airwaves while forcing government workers to attend rallies through intimidation.

He missed his swearing-in for a new six-year term on January 10, but the Supreme Court approved an indefinite delay.