The European Court of Human Rights has told Spain to release an Eta militant jailed in 1989 for terrorism offences, ruling that her rights were violated.
Spain was also ordered to pay the prisoner, Ines del Rio Prada, damages of 30,000 euros (£24,000; $37,000).
Del Rio was jailed for 30 years but was due for release in July 2008, having been granted remission.
However, the remission rules were changed in 2006 and Spain decided to postpone her release until 2017.
The Strasbourg court said Spain must "ensure the applicant's release at the earliest possible date".
Spain's Interior Minister Jorge Fernandez Diaz says Madrid will appeal against Tuesday's court ruling.
Madrid has three months to request that the case be transferred to the European Court's Grand Chamber.
The court, whose grand chamber judgments are binding, said Spain had violated two articles of the European Convention on Human Rights in Del Rio's case: Article Seven (the right to no punishment without law) and Article Five (the right to liberty and security).
Del Rio was arrested in Zaragoza in July 1988 while driving a car packed with explosives intended for an Eta attack on the Costa del Sol.
She was sentenced to more than 3,000 years in jail, most of which was for her role in an attack on the Guardia Civil police in Madrid which left 14 dead and 40 injured, the Spanish news agency Efe reports. That total, for various crimes, was converted into the maximum life sentence of 30 years.
The armed Basque separatist group Eta has been waging a violent campaign against the Spanish state for four decades and is blamed for more than 800 deaths.
It says it wants dialogue with Madrid, but the authorities insist it must first disarm.