Castillo, an elementary school teacher and political novice who won widespread grassroots backing, pledges to rewrite the constitution and redistribute wealth.Peru's presidential candidate Pedro Castillo addresses supporters from the headquarters of the "Free Peru" party, in Lima, Peru June 8, 2021.Sebastian Castaneda / ReutersJune 10, 2021, 9:19 PM UTCBy Reuters

Pedro Castillo maintained a slim lead over rival Keiko Fujimori in Peru’s presidential election on Thursday, with almost all votes counted, but with a chunk of contested votes yet to be scrutinized by electoral authorities.

Castillo, an elementary school teacher and political novice who won widespread grassroots backing, pledges to rewrite the constitution and redistribute wealth, had 50.2% of the vote, maintaining a 0.4 percentage point lead over right-wing Fujimori, or 71,254 votes.

Some 300,000 contested votes are being scrutinized by an electoral jury, a process that will take several days to complete and could delay the announcement of who will take over the presidency at the end of July.

Analysts said that was unlikely to be enough to change the outcome.

Fujimori has yet to concede, though, doubling down on unsubstantiated allegations of fraud.

On Wednesday night, Fujimori, the daughter of polarizing former president Alberto Fujimori, told journalists that she would seek the annulment of about 500,000 votes which she said were suspicious, without providing substantial evidence. She questioned the likeliness of voting tables grouping up to 300 ballots in which she got no votes at all.

Fujimori said those votes should be looked into, adding that she was not accusing the electoral authorities of being complicit in any wrongdoing.

The ethics tribunal of the National Jury of Elections (JNE), the body charged with overseeing the legality of the electoral process, said in a statement on Twitter on Thursday morning that throwing doubt on the results without evidence was “irresponsible.”

Castillo’s Peru Libre Party says there is no evidence of suspicious activity. Independent electoral observers say the vote was carried out cleanly.

Washington said that electoral authorities should be allowed to look into any fraud allegations.

“We look forward to working with the duly elected candidate,” a U.S. State Department spokesperson said.

In Latin America, though, many were already celebrating Castillo’s victory.

Argentina’s President Alfredo Fernandez was the first world leader to congratulate Castillo, saying on Twitter he had contacted the “President-elect” and expressed wishes to join forces for the benefit of Latin America.

In Brazil, leftist former president Luiz Inacio Lula da Silva, who is widely expected to challenge far-right President Jair Bolsonaro in next year’s election, said Castillo had struck a blow to conservatism in the region.

“The result of the Peruvian polls is symbolic and represents another advance in the popular struggle in our dear Latin America,” he said.

Legal woes

Castillo’s 0.4% lead over Fujimori, though slim, is more sizeable than the 0.24% by which Fujimori lost to Pedro Pablo Kuczynski in the 2016 presidential election.

“Then, Fujimori did not demand a recount, but given the political and legal stakes for her, she may do this time round,” said Eileen Gavin, principal analyst of Global Markets and the Americas for risk consultancy Verisk Maplecroft.

Fujimori, who was jailed for more than a year pending a trial over accusations she accepted illegal campaign contributions when she first ran for the presidency in 2011, is still entangled in legal woes. She has denied the allegations and called them political persecution.

On Thursday, prosecutor Jose Domingo Perez requested that Fujimori’s bail be revoked and she be returned to custody pending the trial, arguing that she had been in contact with a witness.

The request will be heard by a judge in the coming days. A spokesman for Fujimori did not respond to a Reuters request for comment.

“Prosecutors are entitled to seek her jailing, but it will be interpreted by people as an attempt to meddle with the electoral process,” said Ernesto de la Jara, a Peruvian human rights lawyer who is critical of Fujimori.

A victory in the presidential election would halt her case until the end of her administration.

Peru, which saw three presidents in a week last year amid political scandals and protests, has been hit by the world’s deadliest COVID-19 outbreak by deaths per capita. The world’s second copper producer posted its worst economic plunge in three decades last year.

Follow NBC Latino on FacebookTwitter and Instagram.