MADRID (Reuters) - Spain acted on Wednesday to block pro-independence politicians in Catalonia from voting in ex-leader Carles Puigdemont, now in Germany, as their regional head with a deadline looming to form a government and avoid fresh elections.

Catalonia's former leader Carles Puigdemont meets his party's leadership in Berlin, Germany, April 18, 2018. REUTERS/Hannibal Hanschke

Madrid said it had appealed a new Catalan law that would have allowed Puigdemont to be elected at a distance while he waits in Berlin for German courts to rule on a Spanish request to extradite him.

“We are appealing (before the Constitutional Court)... against a law that aims to swear in someone who has fled from justice and is living abroad,” Prime Minister Mariano Rajoy told reporters at the lower house of parliament in Madrid.

The Constitutional Court later accepted the appeal, meaning the law will be blocked until the court makes a final decision, which could take months.

Catalan lawmakers must pick a leader to form a government by May 22 to avert more elections and plot a path out of a seven-month standoff which has given Spain, the euro zone’s fourth-largest economy, its worst dose of instability in decades.

A spokesman for Puigdemont’s party in the Madrid parliament played down the chances of fresh elections, saying the two main secessionist parties would agree on an alternative candidate.

“If (Puigdemont’s candidacy) is blocked, I am sure Together for Catalonia and Republican Left of Catalonia will choose a candidate,” Carles Campuzano said.

The disputed law was approved last week by the Barcelona parliament, which is still dominated by secessionist groups since elections last December that Rajoy had hoped would stifle the independence movement.

Puigdemont fled to Belgium in October after Rajoy fired his administration for holding a banned independence referendum, and was then arrested while traveling through Germany.

The central government still has direct control over the parliament he left behind, and it is not clear who the secessionist movement would call on next to take the mantle.

By moving to suspend the law, Madrid is likely to thwart the fifth attempt this year to put forward a leadership candidate, all of whom are either in prison or abroad. Puigdemont has now tried twice.

The deadlock has caused frustration in the pro-independence coalition. Last week, the jailed leader of the Republican Left of Catalonia called on his allies in Puigdemont’s traditionally right-wing group to form a government and shake off direct rule.