Spain's government was not legally able to issue a strict lockdown order last spring, the country’s Constitutional Court has ruled.
The court said that the legislative tool used by Spain to impose the first national quarantine on its citizens was not the right one.
The narrow majority ruling came in response to a lawsuit filed by Spain's far-right Vox party.
Six of the court's eleven judges ruled that the 14 March 2020 decree that introduced the state of health emergency was "unconstitutional and void".
The court did not question the need for measures adopted to reduce the spread of COVID-19 but said the executive of Prime Minister Pedro Sánchez had used the wrong legal mechanism.
Instead of a state of health emergency that requires parliamentary approval, the government should have resorted to a "state of emergency", the court said.
The unconstitutional decision had restricted citizens' basic rights and freedom of movement without legal justification, it added.
During the first wave of the pandemic, Spain only permitted citizens to travel outside alone to collect essential supplies, medicine, go to work, get medical treatment, or assist dependent people. The strict state of health emergency lasted for 98 days before restrictions on movement were lifted.
It is unclear if the Constitutional Court decision will open the gates for lawsuits against the Spanish government.
In practice, the ruling does mean that any fines imposed on citizens by police for breaking lockdown restrictions could be cancelled.
More than 81,000 people have so far died in Spain due to the coronavirus.