BARCELONA (Reuters) - A jailed Catalan separatist leader was entitled to immunity as a member of the European Parliament, the EU’s highest court ruled on Thursday.

FILE PHOTO: Jailed Catalan politician Oriol Junqueras takes the oath as a deputy during the first session of parliament following a general election in Madrid, Spain, May 21, 2019. Angel Navarrete/Pool via REUTERS

Oriol Junqueras was sentenced to 13 years in prison in October for his role in a 2017 Catalan independence referendum that was deemed illegal by Spanish courts. He was elected an MEP while in prison awaiting the verdict and has not been able to take up his seat.

The EU court ruled anyone elected to the European Parliament “enjoys immunities” to travel and take part in parliamentary sessions and an MEP cannot be subject to detention or legal proceedings because of views expressed or votes cast.

The immunity does not, however, apply to an MEP who has committed an offense. The Spanish Supreme Court, which had referred the case to the Court of Justice of the European Union (CJEU), must now decide how to comply with the verdict.

Junqueras’ lawyer Andreu Van den Eynde told reporters the ruling should push Spain’s Supreme Court to overturn his client’s conviction and grant his immediate release from jail.

“I believe that, one way or another, the State Attorney must accept we are right,” he said at a news conference outside the prison where Junqueras is being held.

The ruling could jeopardize efforts by Spain’s Socialists to court Junqueras’ Esquerra Republicana de Catalunya (ERC) party, whose support they need to form a government and break a political deadlock after two inconclusive elections this year.

ERC’s parliamentary spokesperson Marta Vilalta said the party would not return to negotiations until the Socialists and the state attorney react to the verdict.

“What they do and say is very important to show that indeed they are abandoning ... the path of repression and are seriously embracing the political path,” she said.

The acting government said the state attorney would analyze the ruling and present findings in the coming days and that it wanted “a new phase of dialogue, negotiations and agreement” on Catalonia.

The EU court did not examine Junqueras’ criminal case and sentencing. The ruling only responds to the Supreme Court’s questions on the impact of Junqueras being elected as a European lawmaker, a CJEU source said.

If Spanish authorities had wanted to prevent Junqueras from traveling to the European Parliament, they would have had to request the Parliament waive his immunity, the ruling said.

OTHER CATALAN LEADERS

Two other Catalan politicians won European Parliament seats in May but fears of returning to Spain, where they face arrest warrants, prevented them from collecting their MEP credentials.

Carles Puigdemont and Antoni Comin are both living in self-imposed exile in Belgium.

“Today European justice did more to resolve the (Catalan) conflict than two years of repression by Spanish governments and the shameful silence of the European institutions,” Puigdemont said at a news conference in Brussels.

He described Spain’s continuing imprisonment of Junqueras after today’s ruling as a “kidnapping.”

Separately, a Barcelona court ruled the pro-independence president of Catalonia’s regional government, Quim Torra, should be barred from holding public office for 18 months after he refused to remove symbols of support for jailed separatists from public buildings during April’s election campaign. Torra said he would appeal.