Catalan regional caretaker president Artur Mas speaks during a press conference in Barcelona on January 9, 2016
Barcelona (AFP) - Catalonia's separatists on Saturday struck a last-minute agreement to form a new regional government that will work towards independence from Spain, with controversial secessionist leader Artur Mas stepping aside to seal the deal.
His surprise decision brings an end to more than three months of deadlock between Mas' "Together for Yes" secessionist alliance and the more radical, far-left separatist CUP party that together hold a majority in the Catalan parliament.
"This is not an easy decision, but it is a coherent decision," Mas told a press conference, saying he did what was necessary to save the independence drive in the wealthy northeast region of 7.5 million.
"I am stepping aside and will not be standing as a Together for Yes candidate for the re-election of president of the regional government," Mas said, naming Girona mayor Carles Puigdemont as his replacement.
Together for Yes won 62 seats in the 135-seat parliament in regional elections in September -- but were unable to form a government with the CUP, which held a crucial extra 10 seats, due to bitter disagreement over Mas.
The leftist party refused to give Mas its backing, resenting the austerity measures he implemented and corruption scandals linked to his party.
Reacting to the agreement, Spain's conservative government immediately issued a statement emphasising the importance of forming a new national government with "an ample parliamentary base" in order to "face the separatist challenge".
Prime Minister Mariano Rajoy's conservative Popular Party is trying to form a coalition in order to stay in power after losing its absolute majority in parliament in legislative elections last month.
- Sunday parliamentary vote -
If a deal on the regional government had not been reached by midnight on Sunday, Mas would have had to call fresh elections in Catalonia, which would have come as a major setback for the independence drive.
Just days ago, that had seemed inevitable, with Mas saying he was ready to call snap elections as his CDC party -- part of Together for Yes -- refused to consider fielding a different candidate for the presidency.
But after unexpectedly announcing on Saturday that he was stepping down after all, Mas said he supported Puigdemont as his replacement.
The 53-year-old is head of the association of pro-independence municipalities as well as mayor of the city of Girona, around a hundred kilometres (60 miles) north of Catalan capital Barcelona.
He is expected to be formally voted in as regional president in a parliamentary session to be convened on Sunday.
With its own language and customs, Catalonia already enjoys a large degree of freedom in education, health and policing.
But it wants more independence from the Spanish state, particularly where taxation is concerned, complaining it pays more to Madrid than it gets back.
Polls show that most Catalans support a referendum on independence but are divided over breaking from Spain.
A 2010 decision by Spain's Constitutional Court to water down a statute giving Catalonia more powers has added fuel to the fire and caused support for independence to rise.
In November, the separatists passed a motion in the Catalan parliament calling on the assembly to start drafting laws within 30 days to create a separate social security system and treasury, with a view to completing independence in 18 months.
Rajoy immediately filed suit against the move in the Constitutional Court, which annulled the independence motion last month.