A spanish court has struck down coronavirus curbs on entering and leaving madrid, plunging the central governments strategy in the countrys pandemic hotspot into chaos.

The high court for the madrid region ruled the government measures, which came into force on friday after a prolonged dispute between prime minister pedro snchezs leftwing coalition and the regional administration, violated fundamental rights and lacked a sufficient legal basis.

The rules had banned people from entering and exiting the capital without good cause such as for work or education although offenders were not fined while the court decision was pending.

In a sign of the confusion left in the rulings wake, the centre-right regional administration, which took mr snchezs government to court over the issue, said it was dropping further legal action and issued a plea for madrileos not to leave the city.

Spain is celebrating its national day on monday and many people would normally spend the long weekend outside the capital.

No one knows what the rules are, no one knows whats happening, said isabel daz ayuso, the head of the regional administration, who asked the national government to agree by friday new measures that are sensible, fair and well thought out.

Responding to the judgment, salvador illa, spains health minister, said the government would take the decisions that best protect health.

Although both ms daz ayusos peoples party, and the hard-right vox party called for his immediate resignation, the national and regional governments were meeting on thursday evening to discuss the next steps.

The regional administration had argued that the restrictions were excessive and arbitrary and that there was no reason to impose them on the city as a whole. it also contended that measures the madrid region had itself previously put in place to restrict movement in and out of some of the most infected districts had been more effective.

The government countered that madrid as a whole had dangerous rates of infection at present more than twice the figure for spain overall and that the perimeter of the city needed to be secured to prevent infections spreading.

The disarray in madrid contrasts with paris and brussels cities with comparable infection rates, where authorities have ordered the closure of bars and cafs for two weeks and one month respectively. but tension between spains national and regional governments has complicated the countrys response to the pandemic since case numbers exploded in march.

Spain has not updated its legislation to allow lockdowns to be imposed without invoking emergency powers, said pablo simn, professor of politics at madrid's carlos iii university. that means it is judges who decide whether such measures are justified and whether they violate constitutional rights and judges can be inconsistent or disagree with each other. the result is legal chaos.

In recent days, the number of new infections in madrid has dipped, which the regional government says is an indication that its previous measures had been working.

But with 37,000 infections over the past two weeks, and a rate of 564 cases per 100,000 of population in that time, the region of 6.6m remains one of the most afflicted in europe.

After being the worst affected european country for weeks, spain now has the second-highest rate of coronavirus infections on the continent, following the czech republic. infection rates in the netherlands are also approaching spanish levels, as are, to a lesser extent, those in france and belgium.