Separatists won a clear majority of seats in Catalonia's parliament in an election that sets the region on a collision course with Spain's central government over independence.

"Catalans have voted yes to independence," acting regional government head Artur Mas told supporters.

Secessionist parties secured 72 out of 135 seats in the powerful region of 7.5 million people that includes Barcelona.

The strong pro-independence showing dealt a blow to Spanish Prime Minister Mariano Rajoy, three months before a national election.

His government, which has opposed attempts to hold a referendum on secession, has called the separatist plan "a nonsense" and vowed to block it in court.

 

Spain's constitution does not allow any region to break away, so the prospect remains highly hypothetical.

The main secessionist group "Junts pel Si" (Together for Yes) won 62 seats, while the smaller leftist CUP party got another ten, according to official results.

They jointly obtained 47.8% of the vote in a record turnout of 78%, a big boost to an independence campaign that has been losing support over the last two years.

Both had said before the vote that such a result would allow them to unilaterally declare independence within 18 months, under a plan that would see the new Catalan authorities approving their own constitution and building institutions like an army, central bank and judicial system.

Addressing supporters of Junts pel Si in central Barcelona, Mr Mas said a "democratic mandate" now existed to move forward with independence.

"That gives us a great strength and strong legitimacy to keep on with this project," Mr Mas told the exultant crowd.

The vote in Catalonia, Spain's second-most populous region, is widely expected to influence the course of the Spanish general election in December.

Spain's two dominant parties - the ruling People's Party and the opposition Socialists - lost tens of thousands of votes compared with the last election in 2012, boding ill for their national ambitions, although the PP suffered a much deeper setback than its rival.

Anti-austerity Podemos also registered a disappointing score at 9%, sharply down from last May's nationwide regional and local elections.

Among parties opposed to independence, Ciudadanos emerged as the only winner as it jumped to 18% of the vote.

Despite the separatist victory, analysts believe the most likely outcome of the election will be to force a dialogue between Catalan and Spanish authorities.

Opinion polls show a majority of Catalans would like to remain within Spain if the region were offered a more favourable tax regime and laws that better protect language and culture.