By Julien Toyer and Sonya Dowsett

MADRID (Reuters) - Pro-independence parties in the Spanish region of Catalonia struck a deal on Tuesday to form a government, reviving a separatist drive just as Spain faces weeks of uncertainty at a national level following an inconclusive general election.

Parties favoring a split between Spain and Catalonia won a majority of seats in a September regional ballot, but divisions between the various movements had undermined their prospect of pushing forward with an independence drive.

After initial opposition, Catalan anti-capitalist party CUP said it could now back the head of the regional government, Artur Mas, allowing him to stay on as leader.

The deal, which also contemplates an economic plan and a so-called 18-month roadmap to independence, will however have to be rubber stamped by CUP members in an assembly on Sunday.

With Spain's political parties facing weeks of negotiations to form a government, the Catalan issue is now set to come into play again.

"Sunday's results do not change our roadmap, which remains valid," said Raul Romeva, from the main coalition of separatists Junts pel Si' ('Together Yes').

Acting Prime Minister Mariano Rajoy of the People's Party (PP), who had defended Spanish unity and sought to block the independence drive over the past four years, lost his majority in the Dec. 20 general election and could struggle to form a government.

A coalition of left-wing opponents, meanwhile, could include leftist parties from Catalonia that support independence, while Podemos favors a referendum on secession, even if it says it would recommend voting against a split from Spain.

The separatist movement in Catalonia has faced several setbacks in recent months, amid fierce opposition from the center-right central government in Madrid.

In November Spain's Constitutional Court blocked a resolution passed by Catalonia's regional parliament to start an independence process, which entailed setting up a republic within 18 months.

Story continues

Squabbles between the pro-secession parties also penalized them at a national level, and anti-austerity party Podemos ("We Can") topped polls in the region in a general election on Dec. 20.

If the CUP assembly was to reject the deal, fresh elections would have to be held in the region by March.

(Editing by Paul Day and Dominic Evans)