It is one of the darkest and most dramatic moments in recent Spanish history. In the chilling table of daily dead from the coronavirus pandemic, Spain has taken top position from Italy - with 738 dying over 24 hours.

Spain is now the hotspot of the global pandemic, a ghoulish title that has been passed from country to country over four months – starting in Wuhan, China, and travelling via Iran and Italy. As it moves west, we do not know who will be next.

What went wrong? Spain had seen what happened in China and Iran. It also has Italy nearby, just 400 miles across the Mediterranean and an example of how the virus can spread rapidly and viciously inside Europe.

Yet Spaniards cannot blame that proximity. There are no land borders with Italy, while France, Switzerland, Austria and Slovenia – all countries that are doing much better – do have them.

This may, in fact, be one of the reasons for the country’s late response. Spain thought it was far enough away. “Spain will only have a handful of cases,” said Dr Fernando Simón, the head of medical emergencies in Madrid, on 9 February. Six weeks later he gives out daily figures of hundreds of deaths. The number of dead per capita is already three times that of Iran, and 40 times higher than China.

Workers install a field hospital for coronavirus patients in Madrid on 21 March. Photograph: Getty Images

On 19 February, 2,500 Valencia soccer fans mixed with 40,000 Atalanta supporters from Bergamo in Italy for a Champions League game in Milan which Giorgio Gori, mayor of Bergamo, has described as “the bomb” which exploded the virus in Lombardy.

In Spain, Valencia players, fans and sports journalists were among the first to fall ill.

The main reason for the quick spread through Spain may be completely mundane. It has been an unusually mild, sunny spring. In late February and early March, with temperatures above 20C (68F), Madrid’s pavement cafes and bars were heaving with happy folk, doing what Madrileños like best – being sociable. That means hugging, kissing and animated chatter just a few inches from someone else’s face.

On 8 March, just a week before the country was closed down, sports events, political party conferences and massive demonstrations to mark International Women’s Day all took place. Three days later, about 3,000 Atlético de Madrid fans flew together for another Champions League match in Liverpool.

Police officers stand in front of an ice rink turned into a temporary morgue in Madrid on 24 March. Photograph: Manu Fernández/AP

The Socialist-led government of Pedro Sánchez reacted late and clumsily. The country lacked essential equipment. Ventilators, protective clothing for doctors and coronavirus tests are still only just being sourced. China has gone from villain to saviour, as equipment and tests pour in – much of it brokered by the same Chinese immigrant community that has closed shops and shut itself away to avoid a racist backlash.

The virus has laid bare, too, deep faults in the Spanish care system. Private old people’s homes must turn a profit while charging people prices they can afford – which may be a basic pension of just over €9,000 ($9,900/£8,200). As a result, these were understaffed, unprepared and quickly overwhelmed, with death rates of up to 20%. The army was sent in, and found some people lying dead in their beds.

Members of the Military Emergency Unit wait for vans of deceased people for cold storage at the Palacio de Hielo ice rink in Madrid on 24 March. Photograph: Carlos Álvarez/Getty Images

Spain has a magnificent primary care system, but its hospitals have been hit by a decade of austerity since the financial crisis. It has only a third of the hospital beds per capita that are provided by Austria or Germany. Yet that is still more than the UK, New Zealand or the US.

When Sánchez announced that he would be invoking emergency powers, he took more than 24 hours to put them in place – by which time part of the population of Madrid and other cities had dispersed across the country.

Poor coordination meant that the regional government of Madrid had closed universities and schools earlier that week, provoking a holiday atmosphere in which bars and parks were full and many families left for their beach homes.

The lockdown that began on 14 March has been efficiently enforced with police fines and popular pressure (including eggs hurled from balconies). As a result, Spain’s ghastly curve of fatalities will begin to flatten soon and ministers say measures should start being relaxed when the month-long quarantine ends on 11 April. Yet no one expects a return to normality.

When this is over, Spain will be extremely fragile. When the financial crisis hit in 2008, unemployment soared to 27%, public debt leapt upwards and the nosedive into recession was among the worst in Europe. Much the same will happen this year.

The solutions imposed a decade ago – austerity, jobs losses and salary cuts – will not be tolerated. The economist Toni Roldán has calculated that Spain needs a €200bn loan from the European Stability Mechanism (ESM). That, however, must wait. For the moment, Spain must beat the virus. This has been the toughest moment so far, but there may be worse to come.

• This article was amended on 7 April 2020. The Champions League game between Valencia and Atalanta was played in Milan, not Bergamo as an earlier version said. This has been corrected.