MADRID (Reuters) - Spain’s Supreme Court ordered on Friday that Catalan separatist leader Oriol Junqueras must remain in custody after over two months in prison while authorities investigate his role in the Spanish region’s independence movement.

FILE PHOTO: Dismissed Catalan vice president Oriol Junqueras arrives to Spain's High Court after being summoned to testify on charges of rebellion, sedition and misuse of public funds for defying the central government by holding a referendum on secession and proclaiming independence, in Madrid, Spain, November 2, 2017. REUTERS/Javier Barbancho/File Photo

In a written ruling, the judges said there was a risk that Junqueras would again commit an offence if he were released as there was no evidence to show he had abandoned “the path followed so far.” He is being held on allegations of rebellion, sedition and misuse of public funds.

A Dec. 21 election gave separatists a slim majority in the regional parliament in a blow to Spanish Prime Minister Mariano Rajoy, who had hoped it would quash the Catalan independence movement and resolve Spain’s worst political crisis in decades.

The court’s decision will probably prevent Junqueras from being sworn in at the opening session of the new Catalan parliament on Jan. 17 and complicates the separatist parties’ search for a leader who is neither jailed nor abroad.

Junqueras’s Esquerra Republicana (Republican Left) party emerged from the election as the second largest separatist group, a few seats behind former Catalan President Carles Puigdemont’s Junts per Catalunya (Together for Catalonia) party.

Market-friendly unionist party Ciudadanos (Citizens) won the most seats but other unionist parties did not secure enough votes to form a majority.

Puigdemont remains in self-imposed exile in Brussels, though he has said he would return to Catalonia if the Spanish government gave him certain “guarantees”, likely a promise not to arrest him.

After the Supreme Court’s ruling, Puigdemont tweeted: “There is a conflict between Catalonia and Spain that must be resolved. We have always opted for peace and dialogue”.

Esquerra lawmakers have said Puigdemont has the right to again be Catalan president, but if he is unable to return from Brussels he should step aside for Junqueras.

Esquerra and Junts per Catalunya, along with a smaller separatist party, have not yet agreed on a coalition.

Rajoy fired both Junqueras and Puigdemont when he imposed direct control over Catalonia after its separatist-controlled government declared independence following an Oct. 1 referendum on secession from Spain, which courts ruled illegal.

Junqueras’s defense, and other separatist leaders, contend that the independence drive was legal and they have criticized the Spanish government and judiciary for what they call a heavy-handed response.

At a court hearing on Thursday, Junqueras said he was a man of peace and dialogue.

However, judges said on Friday they did not believe that his offer of dialogue indicated he would abandon the “conflict with the state.”