MADRID (Reuters) - Catalan separatist Oriol Junqueras appeared in court on Thursday to ask for his release after more than two months in detention for his role in the Spanish region’s illegal push for independence.

Slideshow ( 2 images )

State prosecutors asked the Supreme Court to keep Junqueras in Estremera prison, outside Madrid, court officials said, which would prevent him from swearing in at the opening session of the new Catalan parliament on Jan. 17.

A Dec. 21 regional election gave separatists a slim majority in the 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.

Junqueras’s Esquerra Republicana (Republican Left) party emerged 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 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.

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.

Junqueras said at the Thursday hearing he was a “man of peace” and of “dialogue,” his lawyer Andreu Van Den Eynde told reporters outside the courthouse. He is in custody on allegations of rebellion, sedition and misuse of public funds.

The court said it would not reach a decision on Thursday.

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

The political instability in Catalonia, which accounts for a fifth of Spain’s economy, has deterred tourists and prompted more than 3,000 companies, including the region’s two biggest banks, to move their legal headquarters elsewhere in Spain.