CARACAS (AFP) - Former paratrooper Hugo Chavez led a self-styled revolution that redistributed Venezuela's oil wealth, earning the devotion of the long-neglected poor while provoking foes at home and abroad.
He won power through the ballot box in 1988 and hung on to it, most recently winning a new six-year term in October. It was cancer that finally defeated the leftist president on Tuesday at the age of 58.
His end came after a three-month period in which the symbolic head of the Latin American left had been neither seen nor heard by his public, fueling rumours and leaving the oil-rich nation and wider region in a state of suspense.
When he had left in December for Cuba - where he had received treatment since 2011 - Mr Chavez had pumped his first and shouted "Onward to life, always!," invoking Che Guevara's famous "onward to victory" battle cry.
But his return from his final trip to the island was announced, not with a rally or red carpet, but with a tweet posted in the dead of night on Feb 18, an ominous sign for a nation accustomed to the larger-than-life leader.
Mr Chavez designated Vice-President Nicolas Maduro his heir, but the former bus driver and union activist is nothing like his charismatic mentor, who captivated huge crowds with marathon speeches, impromptu songs and even dances.
While he was revered among the poor, Mr Chavez left behind a deeply divided nation. Opponents accused him of being a power-hungry despot who failed to curb runaway crime and diversify an economy overly dependent on oil exports.
Mr Chavez was omnipresent in Venezuelan life, hosting his own weekend television show - Alo presidente - while his image was splashed across slums, buildings and even the capital's international airport.
Critics accused him of leading a personality cult.
Inspired by Cuba's Fidel Castro, Mr Chavez adopted the mantle of a socialist firebrand, railing against the "imperialist" United States while befriending controversial leaders in Iran and Syria.
Cancer slowed him down, however, while chemotherapy left him bald for a while. The government had provided few details about the nature, location or severity of the cancer, saying only that it was in his pelvic region.
His faith in God grew during his health troubles, causing him to break into prayer publicly, pleading during Easter Week in 2012: "Don't take me yet." He waited until the final week of the October election to intensify his campaign, showing signs of his old self as he danced in front of hundreds of thousands in Caracas.
Vowing to make his socialist agenda "irreversible," Mr Chavez won the election with 55 per cent of the vote, which would have kept him in office until 2019.
On the world stage, Mr Chavez embraced many US enemies over the years, including Iranian President Mahmoud Ahmadinejad, the late Libyan leader Muammar Gaddafi and Syrian President Bashar al-Assad.
Speaking at the UN General Assembly in 2006, he said the podium still "smelled of sulphur" after George W. Bush had used it, calling the then US president the "devil." At first he warmed towards President Barack Obama, but Mr Chavez soon returned to type, portraying the United States as an evil colonial power while exporting one million of barrels of oil per day to the "empire." He promoted a leftist alternative to the US-led Free Trade Area of the Americas, and was a driving force behind the Community of Latin American and Caribbean States (CELAC).
Born in 1954, Mr Chavez was the son of school teachers from the south-western state of Barinas. He was raised by his paternal grandmother and later studied at the Military Academy of Venezuela in Caracas.
The boy known as "Huguito," who sold sweets in his childhood town of Sabaneta, burst onto the political scene in 1992, when the lieutenant colonel led a failed coup against an antiquated two-party system.
The leader at the time, Carlos Andres Perez, jailed Mr Chavez for two years - an imprisonment that backfired as it turned the soldier into a hero.
Six years later, Mr Chavez took his cause to the polls, winning the presidential election with 56 per cent of the vote.
He was re-elected in 2000 and again in 2006. Three years later, Mr Chavez successfully pushed through a referendum that eliminated term limits.
Mr Chavez's speeches were tinged with nationalist rhetoric, religious references to the "first socialist" Jesus Christ and an almost religious cult to Bolivar, a 19th century South American independence hero.
His biggest challenge came in 2002, when he was ousted in a short-lived coup that lasted 47 hours. He then overcame a two-month oil industry strike a year later and a recall election in 2004.
Though a devout Catholic, Mr Chavez divorced twice. He is survived by four children and three grandchildren.