A woman casts her ballot in Venezuela's referendum
A referendum on Hugo Chavez's presidency was held in Venezuela on 15 August.
It marked the latest stage in an increasingly bitter opposition campaign to unseat the president, who has already survived a coup, a two-month general strike and a previous attempt to force a vote on his leadership.
BBC News Online looks at what the referendum process entails and what the result could mean for Venezuela.
Q: Why did this referendum take place?
It was Mr Chavez himself who sowed the seeds of his potential downfall when he presided over a complete re-drafting of the Venezuelan constitution in 1999. The new constitution was designed to strengthen his position and concentrate more power in the hands of his Movement of the Fifth Republic (MVR).
But it also laid down that any elected official, including the president, can be subjected to a recall referendum after reaching the midway point of his or her term in office. Mr Chavez reached that point on 19 August 2003, and the opposition had been trying to trigger a vote ever since.
The National Electoral Council ruled earlier this year that the opposition had collected enough valid signatures to force the recall vote.
Q: Why did it take so long to call the referendum?
The conditions demanded by the constitution are not easy to fulfil. Any referendum has to be requested by at least 20% of registered voters - in other words, some 2.4 million people. In August 2003, the opposition produced petitions that were said to contain three million names - but most of them had been gathered earlier in the year, before Mr Chavez had reached his mid-term point, and were ruled inadmissible.
So in November, the opposition tried again, with a four-day signature-gathering marathon that produced a new petition. This time, 3.4 million names were handed in, but the electoral council said only 1.9 million were valid.
In a compromise solution, the council set aside five days at the end of May to allow the owners of disputed signatures to confirm that they did, in fact, back the referendum call. At the end of that verification process, the electoral authorities said the target had been reached and the referendum could take place.
Q: What if Hugo Chavez had lost?
The recall referendum took place on Sunday 15 August. If enough people had voted to unseat Mr Chavez, fresh presidential elections would follow in 30 days. The winner of that vote would then serve out the rest of Mr Chavez's term in office, which the Supreme Court has extended until 2 February 2007.
However, it looks almost certain that Mr Chavez has survived the attempt on his leadership.
The date of the recall referendum was crucial. Had it been scheduled for after 19 August, there would have been no prospect of fresh elections until 2007 - in the event of a defeat for Mr Chavez, the vice-president would have taken over instead.
Q: What obstacles did the opposition face?
The opposition had to clear at least two major hurdles if its bid was to succeed. First of all, the referendum would not even have been valid unless at least 25% of the electorate cast their vote. But more importantly, a simple majority against Mr Chavez would not have been enough to oust him - the president's opponents had to match or exceed the number of votes that got him re-elected in July 2000. That amounted to 3.76 million - more than even the most generous assessments of the number of anti-Chavez signatures gathered to date.
Q: How much support does the president still have?
There is no doubt that Venezuela has been bitterly polarised by Mr Chavez's presidency. His supporters praise him for improving the lives of the poor with extensive social programmes - which the government has lately been able to bolster using the extra revenue from soaring oil prices - while his opponents see him as a demagogue who draws inspiration from Fidel Castro's Cuba.
Even if Mr Chavez had lost the recall referendum, it was by no means clear that he would have been barred from standing again in the subsequent presidential election. Since a hatred of the president is the one thing that unites his disparate detractors, Mr Chavez could easily win a new mandate at the expense of what is likely to be a fractious and divided opposition.
Q: What happens now?
The National Electoral Council says the referendum results give Mr Chavez a virtually unassailable lead. If his victory is confirmed, Mr Chavez will be mandated to remain in office until fresh presidential elections in early 2007.
However, whether Venezuela's opposition will accept such a result is far from clear. Members of the opposition have used any means they can - legal or not - to try to secure his overthrow and commentators say this setback is unlikely to quench their zeal. Some warn the threat of violence is never far away in this Venezuelan tug-of-war.