An alliance of pro-separatist parties in Catalonia struck a last-minute deal Saturday to form a new regional government, after months of wrangling that threatened to undermine a fresh bid for independence from Spain.
The Together for Yes (Junts pel Si) alliance, led by acting President Artur Mas, ceded to the demand of the leftist CUP party that Mas step down. In return, CUP entered into a coalition with Together for Yes.
Carles Puigdemont, a former journalist and mayor of the Catalan town of Girona, will replace Mas as president, a position he held since 2010.
Mas said at a news conference that he decided to step aside "in order to move the land [Catalonia] forward."
The formation of a government in the economically strong but politically unstable north-east region had sputtered since elections in September.
While Mas' alliance won the most seats, it failed to reach an absolute majority. To continue to govern, he was dependent on the support of CUP, whose members voted to not back Mas.
Parties faced a Sunday deadline to make a deal or new elections would have been called.
In November, the Catalan parliament in Barcelona passed a road-map for breaking away from Spain.
The government in Madrid took legal action against the plan, which led to the Constitutional Court indefinitely suspending the Catalan legislation in order to hear the central government's challenge.
The current Catalan separatist movement is rooted in the 1939-75 dictatorship of Francisco Franco, who stripped the region of the powers it had been granted during Spain's 1931-36 Second Republic and banned the public use of the Catalan language.
After Franco's death in 1975, a democratic Spain granted Catalonia a wide-self government in areas such as health and education. The region also promotes its language and has its own police force.
In recent years, the push for independence has been propelled by Spain's lacklustre economy. Catalonia is one of the country's wealthiest regions and its economy constitutes one-fifth of Spain's gross domestic product.