MADRID (Reuters) - Spain’s Supreme Court refused on Thursday to release from jail the Catalan government’s candidate to become leader of the region, preventing him from being named to the office on Friday.

Activists put up banners with the photos of jailed leaders of Catalan pro-independence movements ANC (Catalan National Assembly) and Omnium Cutural, Jordi Sanchez and Jordi Cuixart, before Catalonia's former leader Carles Puigdemont addresses a news conference in Berlin, Germany, April 7, 2018. REUTERS/Hannibal Hanschke

The ruling thwarts the Catalan parliament’s second attempt to elect Jordi Sanchez, a pro-independence politician awaiting trial on charges of rebellion.

Hours after the court decision, the regional parliament said it had postponed Friday’s session, without setting a new date.

Instead, parliament speaker Roger Torrent called an extraordinary meeting of officials to decide how to respond to what the institution described in a statement as the Supreme Court’s “rights violation”.

Lawmakers first selected Sanchez in March, but that bid was dropped because he had been jailed for helping to orchestrate pro-independence protests.

That meant he could not attend the meeting of parliament that would have elected him president, and legally he could not be named unless he was present. The court decision on Thursday will keep him from becoming president for the same reason.

Catalonia’s struggle to find a leader began after it declared independence in October. Spanish courts ruled the declaration was illegal, took direct control of the region and called for new elections.

However, a loose alliance of pro-independence groups won the first vote, in December. Since then, Catalonia has tried four more times to choose a president, including the latest attempt to name Sanchez.

On Tuesday, Sanchez had asked the court’s permission to leave prison to attend Friday’s parliamentary session in Barcelona. In a 54-page ruling, Spanish judge Pablo Llarena denied his request, saying there was a risk of a repeat offence.

Torrent said on Thursday that Sanchez - the former head of pro-independence civic group Catalan National Assembly - was the rightful candidate.

“We are working on different fronts ... and believe that the international community, such as the United Nations and the European Union, have to stand up for the defence of democratic values,” Torrent said to private radio station Cadena SER.

Catalan lawmakers have also unsuccessfully put forward former leader Carles Puigdemont and his ally Jordi Turull as potential regional chief, as well as Sanchez.

If a new leader is not named before the end of May, Catalonia will be forced to call another election.

In letters last month to Spanish authorities and Sanchez’s lawyers, a United Nations rights group requested the state take all steps to ensure he be allowed to exercise his right to stand for office, while noting it had reached no decision “on the substance of the matter under consideration”.