Madrid's regional leaders on Friday filed a legal challenge against the imposition of a partial lockdown across the capital and several nearby towns, just hours before it came into force.
Presented to the National Court, the appeal challenges a central government decree which allows for the imposition of restrictions on the capital and nine other nearby towns to slow the spread of the virus.
The new measures, which will mean 4.5 million people cannot leave the city, or their town, except for work, school or medical/legal reasons, will come into force shortly before midnight (2200 GMT).
The decree, which outlines conditions for restrictions in areas where the virus is spreading rapidly, was agreed on Wednesday at talks between the health ministry and most of Spain's 17 regions, who are responsible for managing the pandemic.
In reality, Madrid is the only region where the restrictions will apply given it is struggling with a rate of 730 cases per 100,000 people, compared with just 300 per 100,000 in the rest of Spain -- which in itself is the highest in the European Union.
The region's rightwing government, however, voted against the move but has said it will implement the measures while denouncing them as "not legally enforceable" and pledging a court challenge.
In the first few days, police will not be issuing fines until the new restrictions are validated by a regional court.
The partial lockdown is far less stringent than the one imposed across the country in March and April, which was one of the toughest in the world.
Back then, people were only permitted to leave home to go shopping, to work or for medical reasons and were not initially allowed out for a walk or to exercise.
This time, residents will be able to circulate freely within the city, or their town, although bars and restaurants must operate with limited opening hours and seating capacity.
The virus has now killed nearly 32,000 people in Spain and has infected around 760,000.