Peru's presidential election went down to the wire, with the final ballots trickling in from abroad and frayed nerves reaching the breaking point as the wait entered its fourth day on Thursday.

With 99.5 percent of the polling stations counted, front-runner Pedro Pablo Kuczynski was topping rival Keiko Fujimori, the daughter of imprisoned ex-President Alberto Fujimori, by a 50.1 to 49.9 margin.

While most experts said it's already mathematically impossible for Fujimori to make up the roughly 40,000-vote difference separating her from Kuczynski, she hasn't conceded and her supporters are holding out hope for a turnaround.

"She's worked so hard crisscrossing the country," said Lusa Maria Cuculiza, a congresswoman for Fujimori's Popular Force party. "It would be unfair if she doesn't win."

Dozens of supporters of Fujimori have held demonstrations outside the electoral board to denounce what they said was fraud, even though neither the candidate nor her campaign have presented any evidence to back up their supporters' claims.

Kuczynski, a former World Bank economist, has urged patience from his supporters while talking as if he were already the winner.

Still being counted are the last ballots cast by an estimated 885,000 Peruvians eligible to vote abroad. Peruvians living outside the South American country, most of them in the United States, turned out massively for Fujimori in the 2011 election but with 90 percent of their vote already counted they appear to have favored Kuczynski this time around.

Another potential spoiler is the thousands of handwritten tallies that were being disputed and evaluated by a special electoral board. Currently 677 such tallies representing up to 200,000 votes remain to be computed. Disputes are common in Peru, where voting is mandatory and any observer can lodge a complaint, but they've never proven decisive in past elections and almost always a losing candidate ends up conceding defeat before they are resolved.

Both candidates have remained largely silent while awaiting final results of Peru's tightest presidential race since 1962, a contest that ended in a military coup. While Fujimori has traveled every day to her campaign headquarters, Kuczynski has remained mostly holed-up in his mansion with his family and aides.

President Ollanta Humala on Wednesday urged Peruvians to avoid jumping to conclusions and said the police would remain on alert until results were known.

"We exhort the authorities to deliver the results the quickest and most-responsible manner," he said.

Regardless of who wins, half of voters are bound to be disappointed, making it harder for the next president to govern. Aides in both campaigns were jockeying for positions in an eventual alliance in congress, where Fujimori's party won a solid majority of 73 of 130 seats. Kuczynski's fledgling movement will have just 18, fewer than the country's main leftist alliance.

The 77-year-old Kuczynski was once far behind, but rose by reminding voters of Alberto Fujimori's ties to the corruption, organized crime and death squads for which he's serving a 25-year prison sentence.

Kuczynski also benefited from a last-minute endorsement by the third-place finisher in the first round of voting, leftist congresswoman Veronika Mendoza.

___

Joshua Goodman contributed from Bogota, Colombia.

___

Franklin Briceno on Twitter at https://twitter.com/franklinbriceno. His work can be found at: http://bigstory.ap.org/author/franklin-briceno .