A German court ruled Thursday that deposed Catalan leader Carles Puigdemont may be extradited to Spain, but only for alleged corruption and not on the more serious charge of rebellion.
The decision marks a setback for Madrid, in a case in which Germany found itself at the centre of a politically loaded Spanish dispute.
Puigdemont, 55, was detained in Germany in late March on a European arrest warrant from Spain for his role in Catalonia's failed independence bid last October.
Madrid wants Puigdemont to return to Spain so he can face trial for alleged rebellion, which carries a sentence of up to 25 years.
A court in Schleswig-Holstein had released him on bail on April 6 after finding that he could not be extradited for rebellion -- which is not punishable under German law.
The judges argued that the closest legal equivalent, high treason, did not apply because Puigdemont's actions were not accompanied by violence.
The court reiterated that reasoning in its ruling Thursday, and said Puigdemont would remain free pending final extradition proceedings.
"The alleged actions by the former Catalan government leader do not amount to the German crime of high treason nor the charge of breach of the public peace," the court said.
"The amount of violence required for the charge of high treason was not seen in the altercations in Spain. Breach of the public peace does not apply because Carles Puigdemont was only involved in carrying out the (independence) referendum."
- 'Fight to the end' -
The court noted that European legal practice stipulates that the receiving country -- in this case Spain -- can try the accused only on the charges approved in the extradition order.
This means the Spanish Supreme Court in charge of the case will not be able to try him for rebellion.
Puigdemont hailed the German ruling as a victory.
"The German justice system says that the October 1 referendum was not a rebellion," he said in a tweet.
"Every minute spent in prison by our comrades is a minute of shame and injustice. We will fight to the end and win!"
The court, however, gave the green light for prosecution on misuse of public funds related to the cost of staging the Catalan referendum.
And it rejected Puigdemont's argument that he was at risk of political persecution in Spain.
"It is a far-fetched accusation against the Spanish state as a member of the European Union's community of values and common judicial area," it said.
"The court has unconditional faith that Spanish judicial authorities will respect the requirements of national and international law."
One of Puigdemont's lawyers, Jaume Alonso-Cuevillas, told public broadcaster Catalan TV that they would appeal the decision to extradite to the German Constitutional Court.
"We are convinced that Germany should not play any part in the criminalisation of democratic acts of this kind, and that it should stay out of the highly charged domestic disputes of other states," his German defence team added in a statement.
- Easing tensions -
German prosecutors said they would decide in the coming days whether to approve the transfer of Puigdemont to Spain but described this step as now largely a formality.
Puigdemont is one of 13 separatist leaders accused of rebellion, four of whom are in self-exile in various European countries.
The other nine are in custody in Spain awaiting trial.
With his legal woes preventing him from being re-appointed president of Catalonia, Puigdemont in May anointed a handpicked successor, helping the region to come closer to ending the crisis.
Spain's new government meanwhile has taken its own steps to defuse the conflict.
On Wednesday, the last three separatist leaders held near Madrid over their role in Catalonia's secession bid were transferred to a prison in the region.
Last week, six other leaders had already been transferred ahead of a crunch meeting between Catalonia's separatist president Quim Torra and Spain's new Prime Minister Pedro Sanchez.
Both pledged to ease tensions despite lingering differences over the region's right to self-determination.
As he received the news about Puigdemont at a NATO summit in Brussels, Sanchez remained discreet.
"We do not comment on court decisions, we respect them... whether in Spain, Belgium, Germany or elsewhere," he said.