Former World Bank economist Pedro Pablo Kuczynski won the majority of votes in Peru's closest presidential contest in five decades, election officials announced.

However, his rival Keiko Fujimori has yet to concede defeat.

Four days after voting, electoral officials said that all ballots had been processed and Mr Kuczynski had won 50.1% compared to 49.9% for the daughter of imprisoned ex-president Alberto Fujimori.

Supporters immediately celebrated outside Mr Kuczynski's campaign headquarters while the apparent president-elect made a plea to his opponent and other rival political forces for dialogue.

"We receive this virtual verdict with great humility because Peru has huge challenges ahead of it," Mr Kuczynski said.

"We shouldn't confuse dialogue with weakness. We're going to be decisive but we're going to work on behalf of all Peru because many Peruvians feel the train has left them behind and we want everyone to get on board."

Even as messages of congratulations poured in from presidents around Latin America, Ms Fujimori's campaign seemed in no rush to recognise defeat.

After electoral authorities presented their results, she left her campaign headquarters, where she was holed up in meetings all day, and returned to her home without making any remarks to the throngs of journalists waiting outside.

Aides say she is waiting for the National Electoral Board, the nation's top electoral authority and which sits above the election officials who made Thursday's announcement, to proclaim a winner before conceding.

Her last hope is some 173 handwritten tallies - representing as many as 50,000 votes - that were sent to the board for review.

Among the irregularities detected by Ms Fujimori's campaign were counting more ballots than actual voters at certain polling stations, and allegations that volunteers from Mr Kuczynski's campaign worked at multiple polling stations in violation of electoral law.

Still, experts say it is almost impossible for Ms Fujimori to make up the roughly 40,000 vote difference to overtake Mr Kuczynski.

Ms Fujimori was the favourite to win the run-off but lost ground in the final stretch as fellow conservative Mr Kuczynski warned voters that the corruption and criminality associated with her father's authoritarian rule could return.

Alberto Fujimori is serving a 25-year jail sentence for corruption, organised crime and sanctioning death squads.

While he is loathed by many in Peru, he is revered by others for taming Maoist Shining Path guerrillas and hyperinflation, and Sunday's election was seen partly as a referendum on his iron-fisted rule in the 1990s.

Dozens of supporters of Ms Fujimori have held demonstrations outside the electoral board to denounce what they said were fraud.

Mr Kucyznski would be Peru's oldest president, at 77. The son of a Jewish-Polish immigrant father, his first stint in government in the 1960s was cut short by a military coup.

He ended up moving to the US where he worked at the World Bank and then embarked on a successful career in business. He also served as finance minister twice and Peru's prime minister under President Alejandro Toledo.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.