Nicolas Maduro won the Venezuelan election by a slender margin. But with the opposition demanding a recount and the economy in turmoil, what is next for the new president and the divided country?
In his first rally for the presidency of Venezuela, Nicolas Maduro claimed that his predecessor Hugo Chavez came to him in a dream.
Launching his campaign from Chavez's house in the town of Barinas, a tearful Mr Maduro claimed that the firebrand ruler – who died in March – was reincarnated as a bird and flew over his head, blessing the campaign and promising victory.
On Sunday the "prophecy" from beyond the grave came true, with Mr Maduro winning the election and – in theory – governing the country until January 1919.
But the dream of victory could yet become a nightmare for the children of Chavez, Venezuela's charismatic ruler who dominated the country from 1999 until his death last month. Far from leaving a stable, peaceful nation for his followers, Chavez's legacy is that of a deeply divided and rudderless country.
Mr Maduro, 50, won the election by the slimmest of margins, gaining 50.7 per cent of the vote. His challenger Henrique Capriles, the 40-year-old governor of Miranda state, won 49.1 per cent – a difference of just 235,000 votes in this country of 29 million.
Mr Capriles refused to recognise the result and said his team had a list of 3,000 voting irregularities, ranging from gunshots being fired at polling stations to the illegal reopening of voting centres after they had officially closed.
"I didn't fight against a candidate today, but against the whole abuse of power," he said, demanding a recount.
"Mr Maduro, the loser was you ... This system is collapsing, it's like a castle of sand – touch it and it falls."
Mr Maduro said he would accept a full recount, even as he insisted his victory was clean and dedicated it to Chavez. The election board said Maduro's win was "irreversible" and gave no indication of when it might carry out an audit.
"We've had a fair, legal and constitutional triumph," Mr Maduro told a victory rally. "To those who didn't vote for us, I call for unity. We are going to work together for the security and economy of this country."
Yet creating that secure and economically-successful country will be an immense challenge.
Whereas Hugo Chavez was a former paratrooper who could count on the doggedly-loyal support of the army – they even rescued him when Right-wing rivals staged an aborted coup in 2002 – Mr Maduro does not have that guarantee.
"I think Maduro has an enormous problem, he doesn't understand the military world," said Rocío San Miguel, head of Citizen Control, a Venezuela non-profit that tracks military issues. He told the Wall Street Journal : "Without Chávez, who is going to sit on top of this military hierarchy that has co-opted public administration?"
Nearly half of Venezuela's 23 states have a former military officer as governor, while a quarter of the cabinet is currently composed of members of the armed forces. The army also controls the ports – an influential role in a country where currency controls have created shortages and a thriving black market.
"The president commanded the country like a barracks," said retired army Gen. Raúl Salazar, who was Chavez's defence minister during his first year in office in 1999, but eventually broke with him. Mr Maduro "will have to win over the military and be attentive to them if he wants to stay in power."
Mr Maduro's main rival is Diosdado Cabello – a former army officer with powerful friends in the military – and the dynamic between them is key to the stability or otherwise of the government.
Many expected Mr Cabello, a colleague of Chavez from the military academy who took part in Chavez's 1992 failed coup attempt, to be named as successor rather than the plodding Mr Maduro. Mr Cabello, who is the head of the National Assembly, has pledged to respect Chavez's decision. But he is also known to harbour his own strong political ambitions, and commented cryptically on Twitter that "these results require deep self-criticism."
Another key challenge for the newly-elected president is the economy. Inflation is rampant and the economy is slowing, hampered by Byzantine currency controls and one of the world's worst crime rates. The country was ranked 165th out of 176 in Transparency International's corruption index, and businesses have been scared off by the Chavez regime's policy of nationalisations.
And yet despite the political, economic and social headaches, the result could be seen as the best outcome for Venezuela.
The opposition has been enormously strengthened, with Sunday's close-fought battle in stark contrast to Chavez's 11 per cent victory over Mr Capriles in October's election.
Mr Maduro will also have realised that reliance on the ghost of Chavez will not be enough: he needs to actively improve the life of Venezuelans nationwide, and try to reunite the riven country. The country still has the world's largest oil reserves, and Chavez's memory still resonates just enough to keep his project alive.
But Venezuelans everywhere will be hoping that Mr Maduro can now draw on more than dreamy visions of victory.
Please follow Business Insider on Twitter and Facebook.