Pedro Pablo Kuczynski
Pedro Pablo KuczynskiReuters

Ex-Wall Street banker Pedro Pablo Kuczynski has won the majority of votes with all ballots counted in Peru's photo-finish presidential election, officials said Thursday, but the final result will depend on a handful of challenged ballots.

With all votes finally counted four days after the run-off election, Kuczynski, the son of a Jewish doctor from Germany, had 50.12 percent to 49.88 percent for his rival, Keiko Fujimori, electoral authorities said.

But the gap between them was so small that an electoral court must settle the matter of the 0.2 percent of ballots that have been challenged for smudges, improper markings or other issues before a winner can be declared.

The electoral court is working its way through the challenged results sheets one by one, but there is no clear timeline for how long the process will take.

Pollsters and statisticians say it would be all but impossible for Fujimori, the daughter of jailed ex-president Alberto Fujimori (1990-2000), to pull off a victory.

"Can Peru beat Germany 7-3 in a football match? It's not mathematically impossible, but it's not going to happen," said Farid Matuk, the former head of the national statistics institute, by way of illustration.

Kuczynski, 77, proceeded cautiously, sounding a triumphant note but stopping short of declaring victory. His running mate declared victory in the election earlier this week.

"There's a lot of work to do. It's still not completely official, but we're close," he told journalists outside his house in an upscale neighborhood of the capital, Lima.

Taking to Twitter, he wrote, "Thank you Peru! It's time to work together for the future of our country."

He called for unity in a speech from his campaign headquarters, as he faced the prospect of working with a Congress where Fujimori's party won a majority in the first-round election in April.

Fujimori, 41, did not immediately comment. A spokesman earlier said she would fight to the end.

Electoral authorities had been stuck waiting for seven results sheets to arrive from a remote valley in the Amazon rainforest.

The results were being transported partly by river, with a security escort to keep them safe from the drug traffickers and guerrilla fighters hiding out in the region.

Analysts say Fujimori, who was vying to become Peru's first woman president and led for most of the race, was damaged by a late surge of "anti-fujimorismo."

While some Peruvians fondly remember Alberto Fujimori for his populist streak, his ruthless crack-down on the leftist rebel group Shining Path and his management of a strong economy, his legacy was also heavy baggage for his daughter.

His violent decade in office ultimately landed him in prison for 25 years for massacres by an army death squad.

Kuczynski studied at Oxford and Princeton. A former economy minister, he has a long career in business and finance.

He is a cousin of Franco-Swiss filmmaker Jean-Luc Godard, and his American wife, Nancy, is a cousin of the Hollywood actress Jessica Lange.

AFP contributed to this report.