President Hugo Chavez, the fiery populist who declared a socialist revolution in Venezuela and crusaded against US influence, died on Tuesday at the age of 58 after a nearly two-year bout with cancer.

Vice President Nicolas Maduro, surrounded by other government officials, announced the death in a national television broadcast. He said Mr Chavez died at 4.25pm local time.

During more than 14 years in office, Mr Chavez routinely challenged the status quo at home and internationally.

He polarised Venezuelans with his confrontational and domineering style, yet was also a masterful communicator and strategist who tapped into the country's nationalism to win broad support, particularly among the poor.

Mr Chavez repeatedly proved himself a political survivor. As an army paratroop commander, he led a failed coup in 1992, then was pardoned and elected president in 1998. He survived a coup against his own presidency in 2002 and won re-election two more times.

"El Comandante" - as Mr Chavez was known - electrified crowds with his booming voice, often wearing the bright red of his United Socialist Party of Venezuela or the fatigues and red beret of his army days.

Before his struggle with cancer, he appeared on television almost daily, talking for hours at a time and often breaking into song of philosophical discourse.

Mr Chavez used his country's vast oil wealth to launch social programmes that include state-run food markets, new public housing, free health clinics and education programmes.

Poverty declined during his presidency amid a historic boom in oil earnings, but critics said he failed to use the windfall of hundreds of billions of dollars to develop the country's economy.

Inflation soared and the murder rate rose to among the highest in the world.

Mr Chavez underwent surgery in Cuba in June 2011 to remove what he said was a baseball-size tumour from his pelvic region and the cancer returned repeatedly over the next 18 months despite more surgery, chemotherapy and radiation treatments.

He kept secret key details of his illness, including the type of cancer and the precise location of the tumours.

Mr Chavez stayed in touch with the Venezuelan people during his treatment via Twitter and phone calls broadcast on television, but even those messages dropped off as his health deteriorated.

Two months after his last re-election in October, Mr Chavez returned to Cuba again for cancer surgery, blowing a kiss to his country as he boarded the plane. He was never seen again in public.

After a 10-week absence marked by opposition protests over the lack of information about the president's health and growing unease among the president's "Chavista" supporters, the government released photographs of Mr Chavez on February 15 and three days later announced that the president had returned to Venezuela to be treated at a military hospital in Caracas.

Mr Maduro said that Mr Chavez died "after battling a tough illness for nearly two years".

The death apparently sets up a presidential election to replace Mr Chavez, whose illness prevented him from taking the oath of office for the term to which he was re-elected last year.

Under the constitution, the head of Congress, Diosdado Cabello, would assume the interim presidency.

The announcement came just hours after Mr Maduro announced the government had expelled two US diplomats from the country.

He also said "we have no doubt" that Mr Chavez's cancer was induced by foul play by "the historical enemies of our homeland".

He compared the situation to the death of the Palestinian leader Yasser Arafat, claiming Mr Arafat was "inoculated with an illness".

Mr Chavez's inner circle has long claimed the US was behind a failed 2002 attempt to overthrow him and he has frequently played the anti-American card to stir up support.

Venezuela has been without a US ambassador since July 2010.

Mr Maduro is Mr Chavez's self-anointed successor and has been taking on a larger role since the socialist leader urged Venezuelans to choose him as president before disappearing in early December to undergo a fourth round of cancer surgery in Cuba.

Venezuela's Constitution calls for snap presidential elections and some analysts wondered whether Mr Maduro's suggesting the country was under attack by US subterfuge might not be an excuse to delay the election and tighten his grip on power.