Hellen Nañez’s father died in an intensive care unit in southern Peru last month, the 14th member of her family to die from Covid-19. Aunts, uncles, cousins, her father, a grandfather — all have succumbed to what the government recognised this week was the world’s most deadly outbreak of coronavirus.

“My family life has been totally destroyed,” she said from her home town of Pisco. “I don’t want to leave the house any more. I can’t sleep, I don’t want to eat and I don’t know what I’m going to do next.”

A single mother with a two-year-old daughter, Nañez spent thousands of dollars on medical treatment for her family and is now heavily in debt.

Peru’s failings amid the pandemic have become a central campaign theme as the nation prepares to choose its fifth president in five years on Sunday in a highly divisive run-off election between two candidates who won less than a third of the votes between them in the first round.

The Covid crisis has helped propel a formerly unknown rural primary school teacher and union activist to a narrow lead in the polls. Pedro Castillo is running on a Marxist platform of nationalisation and higher taxes, to the alarm of investors and business people.

“Castillo doesn’t know what he wants to do,” said a senior executive at a Peruvian bank. “He says one thing one day and another thing another day. In any case, the mastermind of the campaign is not Pedro Castillo but [the head of his party] Vladimir Cerrón, who is super-radical . . . Cerrón was educated in Cuba in the most closed economy imaginable.”

But Castillo has fired up poorer Peruvians across the country’s left-behind towns and villages with folksy charm, the story of his life as a teacher in a remote Andean village and a simple message: “No more poor people in a rich country.” His rival, Keiko Fujimori, has no such clear slogan and has struggled to overcome a reputation as an obstructive politician accused of corruption; she denies wrongdoing.

Part of Castillo’s appeal stems from popular anger at Peru’s failure to handle the pandemic effectively. Revised government figures last Monday recognised what excess death figures had been suggesting for months: Peru has the world’s highest coronavirus mortality rate.

The extent of the health disaster might seem surprising. A middle-income country that has grown steadily, invested in public services and reduced poverty over the past two decades, Peru was often lauded as one of Latin America’s success stories.

When the pandemic hit in March 2020, the government imposed a strict lockdown and followed up with generous help for homes and businesses. The lockdown killed the economy, which contracted nearly 40 per cent in the second quarter, but infections and deaths soared anyway amid lax enforcement and ineffective sanitary measures.

María Antonieta Alva, who was finance minister at the time, said the pandemic had shown up the best and the worst of Peru. On the one hand, “prudent management of public finances allowed the implementation of one of the most ambitious economic response packages in Latin America”, she told the Financial Times.

But, on the other, “it uncovered decades of neglect in the microeconomy, the things which affect the day to day life of Peruvians: a collapsed health system, abuse of dominant positions in uncompetitive markets such as oxygen and medicines and alarming levels of financial exclusion”, she said. “These enormous gaps compromised the effectiveness of the measures implemented by the government [to contain the pandemic].”

Peru is the world’s second-biggest copper producer and benefited from strong Chinese demand during the global commodity boom in the first decade of this century. But from 2014, raw materials prices sagged and Peru’s growth slowed, although it remained above the regional average.

Luis Miguel Castilla, a former finance minister who published a 2015 article “The Peruvian Success Story”, pinpointed the election of Pedro Pablo Kuczynski as president in 2016 as a turning point. Kucyznski, a former Wall Street banker, struggled with a hostile congress when Fujimori was leader of the opposition. “The economy went one way and politics went another,” Castilla said.

“You started to have a very high rotation of ministers and senior officials and the country entered a phase of great political instability.” In the past five years alone, Peru has had eight finance ministers.

A bribery scandal surrounding Brazilian construction group Odebrecht hit Peru with particular force, snaring all the country’s recent presidents and leading to Kuczynski’s resignation in 2018; he denies wrongdoing. Odebrecht admitted paying nearly $800m in bribes in 12 countries to win contracts for infrastructure projects, including about $30m in Peru.

Kuczynski, now under house arrest in Lima, says Peru’s economic model fell victim to a triple assault of Fujimori’s obstructionism, the Odebrecht scandal and, later, the failed policies of his successor Martín Vizcarra.

“Keiko never accepted her defeat to me in 2016 and her toppling of ministers started almost as soon as I took power,” he said. “I tried to talk to her as leader of the opposition but she didn’t want to talk.”

The ensuing impasse and public anger discredited the entire political class — at one point, more than half of congress was under investigation for alleged crimes — and paralysed public works projects, as officials hesitated to spend money, fearful of newly zealous prosecutors.

Illustrating the “failed state”, Oswaldo Molina, executive director of the Redes think-tank, said nine of Peru’s 24 regional governments, which are responsible for most health spending, had spent less than 10 per cent of their budgets in the first three months of this year despite the pandemic.

“There was a lot of complacency about the country’s politics,” he said. “The political elites had no interest in changing and the economic elite believed it didn’t need to worry.”

The most recent rankings from the World Economic Forum’s Global Competitiveness Report in 2019 paint a stark picture: Peru is in joint top place for macroeconomic stability but ranks 94th for the quality of its institutions and access to electricity and 117th in workforce skills.

Optimism is in short supply. “Whoever wins, social convulsions will continue,” said Castilla. “The root of the problem is the political system.”

What has happened to Peru, he added, was probably inevitable. “The state has not played its role — it has totally failed.”