The European Court of Justice has decided to reinstate the parliamentary immunity of the former president of Catalonia, Carles Puigdemont.
Judges ruled on Tuesday that Puigdemont and two other Catalan MEPs, Toni Comín and Clara Ponsati, should not immediately face trial in Spain.
The precautionary measure was taken as there was a "high probability" Puigdemont would now be arrested, the court said. His lawyer hailed Tuesday's decision on Twitter as "a provisional victory".
The three MEPs are wanted in Spain in connection with an independence referendum in Catalonia that took place in September 2017 and was later ruled "illegal" and "unconstitutional".
Facing charges of sedition in Spain for his role in the push for Catalan independence, Puigdemont had fled to Belgium in October 2017.
Comín, the former health minister, and Ponsatí, the regional education minister, also left the country and went on to win seats in the European Parliament. In addition to charges linked to their role in the referendum, Puigdemont and Comín are accused of misusing public funds.
Last year, other MEPs voted to strip the three of their parliamentary immunity, meaning they could be extradited and face trial in Spain.
Puigdemont was subsequently arrested in Sardinia in September but freed after just one day as the Italian judiciary was compelled to await the outcome of his appeal to European Court of Justice.
For now at least, the three have had their immunity reinstated. Puigdemont wrote on Twitter that the decision was "another positive result" and vowed to continue fighting for his and others' freedom.
Judges in Spain initially handed jail terms of nine to 13 years to nine other Catalan pro-independence leaders for their role in the independence vote.
But they have all since been pardoned by Spanish Prime Minister Pedro Sanchez and were released from prison, having each served between three and a half and four years.
In a statement at the time, the Spanish cabinet said the pardons, which were strongly opposed by the country's right wing, were issued in an effort to reconcile central government's relations with the region.
The former prisoners will not be able to hold public office until the end of their original sentences and will be sent back to prison if they break Spanish law again.
Puigdemont announced earlier this month that he will step down as president of his Junts per Catalunya party after an upcoming conference in early June.