With coronavirus cases spreading like wildfire, the entire city of Madrid is to be put under partial lockdown, Spain's government said Wednesday as it stepped up measures to fight the epidemic.

But Madrid's regional government reacted furiously to the new restrictions that affect mobility and gatherings, setting the scene for a political battle which could be dragged into the courts.

"The situation in Madrid is complex and worrying," Health Minister Salvador Illa told reporters, saying that of 11,016 new cases diagnosed in Spain over the past 24 hours, nearly 44 percent were in the Madrid region.

"That's why we have agreed to adopt these measures but we're aware that hard weeks lie ahead," he said after talks with Spain's 17 autonomous regions who are responsible for public healthcare and managing the pandemic.

Spain is currently struggling with the highest number of new cases within the EU with a rate of around 300 per 100,000 inhabitants -- but in the Madrid region, the rate currently stands at more than 780 per 100,000.

Madrid has seen a surge in coronavirus cases in Spain's second wave
Madrid has seen a surge in coronavirus cases in Spain's second wave AFP / OSCAR DEL POZO

The announcement sparked a backlash from Madrid's top health official Enrique Ruiz Escudero who suggested the region could fight it through the courts.

"This is not legally enforceable," he said, insisting the situation was "stable" and accusing the government of pedalling "a message of alarm and agitation".

Prime Minister Pedro Sanchez's left-wing government has been locked in a standoff with Madrid's right-wing administration over its management of the crisis.

If the measures are published in the official government bulletin, as they plan to be, Madrid's regional government "would assess what kind of decisions were necessary," Enrique Ruiz Escudero said.

Madrid's restrictions mean people cannot leave their neighbourhood except for work, school, or medical reasons
Madrid's restrictions mean people cannot leave their neighbourhood except for work, school, or medical reasons AFP / OSCAR DEL POZO

After the talks with regional leaders, Illa said these had agreed "by a broad majority" to impose restrictions in all areas with more than 100,000 residents within their jurisdiction if three conditions were met.

The area must have reported more than 500 cases per 100,000 inhabitants over the previous 14 days; it must have 35 percent or more intensive care beds occupied by Covid-19 patients, and positive results in at least 10 percent of PCR tests.

In the affected areas, there will be restrictions on mobility, all bars and restaurants will be forced to limit their opening hours and seating capacity, while social gatherings will be reduced to just six people.

Madrid is currently the only region with areas that meet all three criteria -- including parts of the capital, which has three million residents.

The greater Madrid region has 6.6 million residents and so far, the authorities have imposed a partial lockdown on just over a million of them, mostly in poorer areas south of the city.

There, people cannot leave their neighbourhood except for work, school or medical reasons.

But they are not confined to their homes and can circulate freely in their own district although parks are closed and bars and restaurants can only operate with limited opening hours and seating capacity.

It was not immediately clear how the new mobility restrictions would work, with details to be published in the official government bulletin in the coming days.

Spain is currently fighting a second wave of the virus, which has now killed more than 31,000 people and infected close to 760,000 in what is the highest infection rate within the European Union.