Uruguay's run-off hangs on a knife edge, with the winning candidate in Sunday's run-off unlikely to be formally identified until the end of the week.
Conservative candidate Luis Lacalle Pou was closing in on the presidency after a run-off on Sunday, exit polls initially showed, with the Partido Nacional leader set to oust Uruguay's long-dominant leftist Frente Amplio coalition. However, as results trickled in it became clear that ex-Montevideo mayor Daniel Martínez was gaining.
With 97.97 percent of votes counted, Lacalle Pou had won 48.74 percent of the vote, versus 47.48 percent for Martínez. In raw vote terms, the conservative candidate had 1.145 million votes to his rival's 1.115 million.
With the difference between the two candidates down to under 35,000 votes at the time of writing, Uruguay's election authorities said the result would probably be known "Thursday or Friday." Officials will take the next few days to scrutinise ballots, with some analysts expecting Martínez to call for a recount.
Polls had shown that Lacalle Pou was likely to defeat Martinez by between six and eight points.
Thousands of Lacalle Pou's supporters massed around his party's headquarters in Montevideo on Sunday, but they were ordered to hold back on celebrations until the official results came through.
The scene at the Frente Amplio's headquarters of the Broad Front were similarly reserved about conceding defeat.
Lacalle Pou, a senator, trailed Martínez in last month's first round, but a pact with centre-right and right-wing parties following simultaneous legislative elections gave him a majority in Congress as well as a significant lead heading into the run-off.
A win for the right would "reflect a trend in the region of voters rejecting the incumbent party over disappointing results," said Robert Wood, Latin America specialist with the Economist Intelligence Unit.
With bright and sunny weather, more than 70 percent of the country's 2.6 million eligible voters had cast ballots three hours before the polls were due to close, Electoral Court Chairman José Arocena said.
"We want the Frente to win, because we feel that with the left our rights are guaranteed," said Juan Pablo Abella, 40, as he walked to a polling station in Montevideo's upmarket Villa Biarritz district with his wife and nine-year-old daughter.
Abella said both he and his wife were born under Uruguay's dictatorship and for them, voting was both a right and a duty.
"Seeing how things are in the region, not everyone has the possibility to choose. You have to value that," he said.
The run-off is effectively a referendum on 15 years of rule by the Frente Amplio, which has won the last three elections.
"Voters are tired of economic stagnation, high unemployment and rising crime since the end of the commodity supercycle, and will look to Mr Lacalle Pou for improvements," Wood told AFP.
Inflation is running at 7.5 percent and unemployment at nine percent.
Outgoing president Tabaré Vázquez noted the turmoil sweeping Latin America – the resignation of Evo Morales as president of Bolivia, and sometimes violent street protests in Chile and now Colombia – and said Uruguay will carry out a smooth transfer of power to a new president in March of next year.
"The people of Uruguay can rest assured that we are going to achieve this," Vázquez told reporters.
In a highly unusual incident in the early hours of Sunday, a bus carrying military personnel to guard ballot boxes was stoned by people participating in an electronic music festival in Montevideo.
Uruguayan media and videos circulated on Twitter showed several cars had been damaged.
"When I saw that this morning, I thought it was another country. Unfortunately it was Uruguay," said Lacalle Pou, who has promised to get tough on rising crime levels.
The Frente Amplio, a coalition of leftist movements, can point to a record of progressive governing since it broke a decades-long conservative stranglehold on the government in 2005.
Uruguay has stood out on the international stage by approving abortion and gay marriage, and the small nation pioneered the legalisation of cannabis in 2013.
But Lacalle Pou has tapped into voter concerns over the country's high tax rates and promised to look elsewhere to raise the US$900 million needed to reduce the public deficit, nearly five percent of GDP.
Uruguay has long been considered a bastion of peace and stability in an often turbulent region.
But public safety has been eroding, with a sharp rise in some violent crimes reported last year.
In 2018, the region's second-smallest country registered a record 414 murders, up 45 percent on the year before.