Spanish MPs on Thursday approved an amnesty law for Catalan separatists with their figurehead Carles Puigdemont already mulling his return after years of self-imposed exile to avoid prosecution over the 2017 independence bid.
Lower house lawmakers voted 178 in favour to 172 against with the bill seeking to draw a line under years of efforts to prosecute those involved in the botched secession bid that triggered Spain's worst political crisis in decades.
Passing the amnesty is a key moment for Prime Minister Pedro Sanchez as it was a demand made by separatist parties in exchange for their parliamentary support to allow him to serve a new term in office.
It comes six weeks after an earlier version of the bill was voted down by lawmakers.
The text will now be put to the Senate, which is controlled by the right-wing opposition Popular Party (PP) that is resolutely opposed to the measure and has vowed to do everything possible to delay its passage before returning it to the Congress lower house for final approval.
Drafted by ruling Socialists and two Catalan separatist parties, the text is the most controversial piece of legislation parliament has voted on since Sanchez came to power in 2018, even dividing his own electorate.
Justice Minister Felix Bolanos said the amnesty law would affect "around 400 people".
Talking to reporters in the European Parliament, where he is a lawmaker, a cheerful-looking Puigdemont expressed hope that the law would be in force "by the end of May", saying late on Wednesday that he hoped to return to Spain in the weeks that followed the final passage of the bill into law.
As Catalan leader at the time, he led the 2017 independence bid, fleeing to Brussels to avoid prosecution, while nine of his fellow secessionists who stayed in Spain were tried and jailed.
Three years ago, the government pardoned them.
In the run-up to July's general election, Sanchez had said he was against any offer of amnesty, but electoral calculations forced a change in his approach after the vote resulted in a hung parliament.
In order to secure a new term in office, Sanchez was forced to seek the support of the two separatist parties, Puigdemont's hardline JxCat and its more moderate rival ERC.
In exchange, JxCat demanded the amnesty law.
ERC leader Oriol Junqueras, who was one of those jailed and then subsequently pardoned, expressed satisfaction with the outcome of the vote.
"We have always wanted justice to prevail as soon as possible and for me it will be a pleasure to meet again with all our comrades in exile," he told Spain's TVE public television.
On January 30, parliament held a first vote on the amnesty bill, but lawmakers rejected it in a humiliating defeat for Sanchez, as JxCat's seven MPs voted against it on the grounds that it did not go far enough.
For Puigdemont, the wording did not offer sufficient protection against prosecution on charges of terrorism or treason.
A month after the failed vote, Spain's top court said it was opening a probe into Puigdemont on "terrorism" charges over street protests linked to the 2017 crisis.
The Socialists then moved to reopen talks on the wording of the amnesty bill despite the risk that the new text could be ruled unconstitutional.
The new version removed all references to the Spanish penal code and used only European norms that offer a different definition of terrorism.
The Spanish right, which has been implacably opposed to the bill, has remained defiant.
For the PP, the amnesty bill has always been nothing more than Sanchez "buying" the separatists' votes to stay in power.
"You have bought seven votes for... an amnesty. And that is corruption," PP lawmaker Agustin Conde told parliament on Wednesday.