A trade unionist will face the conservative heir of the powerful Fujimori family in Peru in a divisive presidential run-off.
Sunday's first round saw leftist Pedro Castillo, who has promised to write a new constitution, take a surprise lead.
His challenger will be Keiko Fujimori, the daughter of the imprisoned former president who herself faces corruption allegations, which she denies.
Voters are concerned about the economy and the handling of the pandemic.
With nearly 96% of the votes counted, Mr Castillo had 19% while Ms Fujimori was on 13%, according to Peru's electoral authority.
Both candidates were well short of the simple majority needed to win outright a first round that had 18 contenders. The run-off vote will be held on 6 June.
Who is Pedro Castillo?
The 51-year-old primary teacher from Peru's Cajamarca region started his political career in 2002, when he unsuccessfully ran for mayor.
In 2017, he became a prominent figure in a teachers' strike over pay and in October 2020 he announced he would run for president for the left-wing Free Peru party.
In opinion polls ahead of the election, he had failed to make it into the list of top six candidates, barely registering 3% in a poll taken in mid-March.
His support on Sunday seems to have come in particular from remote rural areas, which pollsters rarely reach. Mr Castillo thanked his voters in a brief speech, saying he wanted to greet those "who have been forgotten, who live in the corners of our homeland where there is no state presence".
Mr Castillo managed to appeal to many Peruvians who are fed up with the corruption scandals which have overshadowed politics for years.
He has said that he is not out to enrich himself and that if elected, he will only draw the salary equivalent to what he is paid as a teacher. He also wants to lower the salary paid to lawmakers.
He argues that Peru has not been governed in the interest of the vast majority of Peruvians and has called for "drastic changes".
He has backed calls by anti-government protesters for a new constitution and says that under his leadership a constituent assembly will be created to draft a constitution that "has the colour, smell and flavour of the people".
During his campaign, Mr Castillo proposed nationalising companies in a number of "key" economic sectors such as mining, oil, hydroelectric and gas.
Who is Keiko Fujimori?
The 45-year-old former congresswoman represents the Popular Force Party and lost presidential election run-offs in 2016 and 2011.
She is the daughter of former President Alberto Fujimori, who is serving a 25-year prison sentence for human rights abuses.
A free-market supporter, Ms Fujimori says she will use Peru's mining income to boost the economy. She has also said that she will create two million jobs by expanding infrastructure and investing in health and education.
She has criticised the lockdowns imposed by the government to curb the spread of Covid-19, and promised to lift restrictions to try to revive the economy.
Ms Fujimori herself is being investigated for alleged corruption and money laundering, claims she says are politically motivated. She spent 13 months in jail between 2018 and 2020.
She has not yet commented on the results. In recent days she said she would confront "populism and the radical left" and that she trusted Peruvians who did not want to see the country turn into "a Cuba or Venezuela" to support her.
What's the background?
Peru has been through a series of political crises in recent years causing great instability at the very top of the political system.
In November last year, Peruvians were led by three presidents within the space of a week as then-leader Martín Vizcarra was impeached.
It has also been badly hit by the Covid pandemic. It is the country in South America with the highest number of Covid-19 deaths per capita, according to Johns Hopkins University figures.
Trust in politicians, while already low, was further eroded by the so-called "vaccinegate", the revelation in February that previous and current government officials secretly got vaccinated early against Covid-19.
Peru's economy has also felt the impact of the pandemic, contracting by 11% in 2020. More than 2.2 million people have lost their jobs.