Colombia's next president will be a choice between a former leftist rebel and a man dubbed the country's Trump after Sunday's first round of voting.
Gustavo Petro, a former mayor of the capital Bogotá as well as an ex-militant, topped the poll as expected, taking around 40% of the vote.
But Rodolfo Hernández came second despite opinion polls favouring conservative Federico Gutiérrez.
Mr Hernández and Mr Petro will face off in the second round on 19 June.
If Mr Petro, 62, wins he will be the first left-wing president in the country's history. He has promised to fix the country's deep inequalities and switch its reliance on fossil fuels to clean technology.
The unexpected result for Mr Hernández, a 77-year-old construction magnate with a populist touch reminiscent of the US's ex-President Donald Trump, marks an upset for the traditional right.
He campaigned on an anti-corruption ticket, despite being under investigation for allegedly favouring a company his son had lobbied for.
Whoever wins next month will have to grapple with discontent over increasing inequality and inflation, as well as the legacy of the bloody war between leftist guerrillas and the state which a 2016 peace agreement was meant to end.
Iván Duque, the deeply unpopular outgoing president, was not allowed to stand again because he was restricted to a single term by the constitution.
As news spread of Mr Petro's lead in the first round, his supporters celebrated in central Bogotá.
"People are showing they are tired of the same thing, that they want a change," sound engineer Cristian Riano, 35, told Reuters news agency.
Mr Petro's running mate, the environmentalist Francia Márquez, hopes to become the nation's first black vice-president.
Federico Gutiérrez, the man seen as the ideological successor to Iván Duque, had been tipped to come second but, with nearly all the votes counted, he had won just under 24% while Mr Hernández was on 28%.
Accepting defeat, Mr Gutiérrez called on his supporters to back Rodolfo Hernández and his running mate Marelen Castillo in the second round.
The second round promises to be a tough fight.