Colombia headed for its most divisive presidential race in decades after rightwinger Ivan Duque won Sunday's first-round vote, triggering a runoff with leftist Gustavo Petro that could upset a historic peace deal or derail business friendly reforms.
It was the first time in the modern history of the conservative South American nation that a leftist candidate had reached the second round of a presidential vote, a prospect that has spooked some investors in Latin America's fourth-largest economy in recent weeks.
Duque, a 41-year-old former official of the Washington-based InterAmerican Development Bank, was the convincing winner of the ballot with 39 percent of votes, ahead of Petro, an outspoken former mayor of Bogota, on 25 percent, in line with polls.
However, Duque's pledge to overhaul the 2016 peace deal with the Revolutionary Armed Forces of Colombia (FARC) by scrapping immunity for those convicted of crimes has worried many Colombians, weary after five decades of conflict that killed about 200,000 people.
Though outgoing President Juan Manuel Santos won the Nobel Peace Prize for forging the accord, it deeply divided the nation of more than 50 million people and was narrowly rejected in a popular vote before Congress finally approved a modified version.
Petro, and three other losing candidates, have backed the deal, meaning Duque may need to moderate his position to attract wavering voters.
Center-left mathematician Sergio Fajardo, who came third, with 24 percent of votes, declined to endorse either candidate for the second round, saying his supporters would make up their own minds.
Political pundits in Colombia said that if June's vote went along ideological lines, the votes of the centre-left could be enough for Petro to seriously challenge Duque, if he can dodge his rival's accusations of radicalism.
"Petro was quite clearly behind Duque in the vote, so that will reassure the markets," Camilo Perez, head of economic studies at Banco de Bogota. "But the fact that Fajardo was so close to Petro may generate nervousness, as his approach is probably closer to Petro's and that could send votes his way."
The winner of the second round will face an intimidating array of challenges, from stubbornly low economic growth to threats to Colombia's prized investment grade credit rating, besides difficulties in implementing the peace accord.
Some areas abandoned by the FARC have suffered an increase in fighting between criminal gangs and a remaining guerrilla group, the National Liberation Army (ELN), over valuable illegal mining and drug trafficking territories.
Colombia's production of coca, the raw material for cocaine, tripled between 2012 and 2016, stirring concern in Washington.
Polls suggest the end of the FARC conflict has shifted voters' priorities to inequality and corruption from security issues - opening the door to the left for the first time.
However, a growing crisis in neighboring socialist-run Venezuela, which has driven hundreds of thousands of desperate people to flee across the border, is a thorn in the side for Petro, with Duque's camp saying he would plunge Colombia into a similar crisis.
Petro has promised to take power away from political and social elites he accuses of having stymied development, and to carry out a complete economic overhaul.
At his election night party in the capital, communist party militants waved red flags above the crowd, yet Petro struck a moderate tone as both he and Duque sought to attract centrist voters.
"When we talk about defeating poverty, we're not talking about impoverishing the rich, but about enriching the poor," said the bespectacled Petro, surrounded by family members.
However, in a country where oil and coal are the top export earners, Petro's pledges to end extractive industries and shift the focus of state-run oil company Ecopetrol to renewable energy have dismayed business leaders.
"Our country has never lived such a polarized moment as this and Petro represents a huge danger, but we are going to beat him," Mariana Riaño, a 21-year-old student, said at Duque's celebration party at a conference centre in Bogota.