Europe’s top court has ruled that a former vice president of Spain’s Catalonia region who is serving a prison sentence for launching a banned independence referendum should have the right to parliamentary immunity.

The European Court of Justice (ECJ) found that Oriol Junqueras, who was part of the Catalan cabinet that went ahead with a banned secession referendum in October 2017, had a right to immunity because he was elected to the European Parliament in May.

The Luxembourg-based Court of Justice said people like Junqueras who are elected as EU parliamentarians “enjoy, from the moment the results are declared, the immunity” to travel to and take part in parliamentary sessions.

READ MORE: Matthew Tree: Catalans believe Scots will be spared violence on the streets 

Junqueras was sentenced in October to 13 years in prison for sedition, along with several other associates.

He was already incarcerated when he was declared to have won the European Parliament seat.

Spain’s supreme court refused to allow him to leave prison to take an oath to respect the Spanish constitution, a requirement the country places on politicians before they can take up their seats as EU MPs.

The Spanish electoral commission later ruled that his seat was vacant and suspended his parliamentary prerogatives.

READ MORE: Europe must condemn the repression of the Catalans 

It is unclear what the EU court’s ruling might mean for Junqueras’ future.

His case could set a precedent for fugitive former Catalan leader Carles Puigdemont, who was also elected to the European Parliament in May and has been living in exile in Belgium.

Mr Puigdemont is the subject of a Spanish arrest warrant over the independence referendum but he has also launched an appeal at the ECJ.

A court in Brussels ruled earlier this week that it would await the outcome of his European case before deciding whether to extradite Mr Puigdemont.