Marxist village schoolteacher Pedro Castillo has won Peru‘s presidential election, the National Election Board (JNE) said on Monday.

The candidate of the Marxist-Leninist Peru Libre party received 50.12 per cent of the vote to right-wing populist Keiko Fujimori’s 49.87 per cent in the June 6 election, according to the country’s electoral body ONPE.

The country’s supreme electoral body proclaimed Castillo winner of the close run off race after weeks of complaints and appeals, mostly from the Fujimori camp. Castillo won by just over 44,000 ballots, according to ONPE.

Fujimori, 46, was initially leading, but the tide turned when the votes from rural areas, where Castillo has strong support, were counted.

She alleged “irregularities” in the counting and “signs of fraud,” in allegations dismissed by ONPE. Election observers of the Organization of American States (OAS) also declared that the election had taken place without any major irregularities.

On Monday, Fujimori said in a televised address that she would “accept the results because that’s what the law and the constitution that she has sworn to defend prescribe.”

More than 25 million Peruvians were called on to cast their ballots in the election. The turnout topped 18 million.

“Thank you to the Peruvian people for this historic triumph,” Castillo, 51, tweeted.

“The time has come to call on all parts of society to build together, in this Bicentennial, an inclusive Peru, a just Peru, a Free Peru.”

Castillo’s victory is a resounding blow to the political elite in Lima. He was considered an absolute outsider and before the start of his campaign he did not even have a Twitter account.

The 51-year-old wants to build a socialist state, tighten control of the media and abolish the constitutional court.

The markets took a hit after the first signs of his victory, with observers concerned that foreign investors will pull capital. Up until now Peru was considered a financially liberal country for the area.

Fujimori, who had planned if she won to pardon her father, former authoritarian president Alberto Fujimori, stood for a neoliberal economic policy and a hard-line security strategy.

In recent years, she has been remanded in custody several times and could face a long prison sentence in an ongoing corruption trial.

Although Castillo and Fujimori represent opposite extremes on the political scale, they are not far apart in their socio-political views: Both represent a conservative image of the family and are against same-sex marriage and abortion.

Both focus on the exploitation of natural resources and do not attach great importance to the protection of the environment and human rights.

Castillo will face enormous challenges. Peru is suffering particularly badly from the coronavirus pandemic: It is one of the countries with the highest mortality rate in the world and its economy collapsed by 12.9 per cent last year.

In addition, splinter groups of the guerrilla organization Sendero Luminoso (Shining Path) are still active in the country’s interior.

Political turmoil has marked the past year, as the Congress was locked in a bitter conflict with the government: Parliamentarians first forced president Martin Vizcarra out of office, and then his successor, Manuel Merino, threw in the towel after fierce protests.

Sagasti has been in charge meanwhile.