BARCELONA (Reuters) - Catalan secessionist parties failed on Thursday for a third time to elect a regional president, leaving them with a deadline of two months to pick someone or hold a new election.

Slideshow ( 7 images )

Jordi Turull, a close ally of former president Carles Puigdemont, needed 69 votes to be elected but obtained only 64.

Sixty-five lawmakers voted against him, while the four members of far-left group CUP broke ranks with the rest of parliament’s pro-independence bloc by abstaining.

Catalonia has been in political limbo since Spanish Prime Minister Mariano Rajoy Madrid took over the wealthy northeastern region’s government after a unilateral declaration of independence in October.

He called a December election in an attempt to derail the independence movement.

The plan backfired as parties favouring a split with Spain won the vote, though they have been unable to agree on a common strategy or elect a new regional president.

CUP backs outright independence while Catalonia’s other secessionist parties are more favourable to engaging with central government in Madrid.

Puigdemont, and another ally who went with him into self-imposed exile in Brussels after last year’s independence push unravelled, did not cast votes in the Turull election.

Turull could still be chosen in a second vote due to take place on Saturday when only a simple majority is needed, but it is unclear whether this will happen.

He was briefly held in custody on charges of rebellion and sedition after his involvement in the independence push in October. He was released on bail after accepting central government control over the region but still faces the prospect of a trial.

He and other secessionist leaders are due to appear before the Supreme Court on Friday morning for the opening of a new phase in the investigation which precedes a trial.

The judge could declare him ineligible or even send him back to jail if he concludes that there is enough early evidence that he committed those crimes.

If Turull is not elected in a second vote or that vote does not take place, parties would have to elect another candidate within two months or hold another election, likely in early July.

Madrid has made clear it would stop any candidate who has taken part in the secessionist drive from taking office.

Puigdemont and Jordi Sanchez, a leader of a prominent grassroots group who is in jail over his role in the illegal campaign to split from Spain, have both withdrawn their bids for the presidency because they could not attend a swearing-in session.