Polling supervisors count ballots in Barcelona | Pau Barrena/AFP via Getty Images Catalan separatists win back majority, defying Spain’s Rajoy Pro-unity Ciudadanos comes in first in terms of votes, but unable to form a government.

BARCELONA — Catalan separatists won an absolute majority in the regional parliament in Thursday's election, crushing Madrid's hopes of halting the push for independence.

The result will be a blow to Spanish Prime Minister Mariano Rajoy's hopes that the ballot would set the region on a path to normality after the chaos that followed a referendum and unilateral declaration of independence in October.

"Rajoy has lost! Rajoy has lost!" Eduardo Pujol of Junts per Catalunya, the largest of the pro-independence parties, told cheering supporters in Barcelona.

The separatists managed to retain the majority of seats that they won in the last regional vote two years ago despite the fact that their top leaders have been jailed or have taken refuge abroad. That includes the ousted regional president Carles Puigdemont, who is in Belgium, and his former deputy Oriol Junqueras, who is in a Spanish prison.

However, the result puts the centrist, pro-unity Ciudadanos in first place with a significant advantage in terms of votes, but unable to form a government. Its success will be closely watched by Rajoy, whose conservative Popular Party (PP) risks losing ground across Spain to the youthful, pro-business Ciudadanos.

Ciudadanos' leader in Catalonia, the Andalusian-born Inés Arrimadas, was hailed by her followers with chants of "President! President!" Arrimadas said her party's success showed that the region was more diverse than the media coverage of the October independence referendum suggested.

Provisional results give the separatists 70 seats in the chamber, down two from the election in2015, but still enough for an absolute majority.

The grassroots independence movement Catalan National Assembly (ANC) hailed the result as a victory, though it considers the regional election called by Rajoy, after he sacked the entire Catalan Cabinet and dissolved the regional parliament, as illegitimate.

The ANC's leader Jordi Sanchez was jailed in October along with other regional officials and separatist campaigners, after the referendum and ensuing unilateral declaration of independence.

"With these results, the people have ratified the republic," said ANC Vice President Agustí Alcoberro, in a statement which described Madrid's use of Article 155 of the constitution to take direct control of the region as "a coup d'état against the republic."

Alcoberro demanded the immediate release of Catalan officials he described as "political prisoners" and "hostages," the safe return of regional officials from exile, and the restoration of the regional government.

Speaking to followers and reporters in Brussels, where he has had little success rallying official European Union support for the Catalan separatist cause, Puigdemont said: “The republic of Catalonia has beaten the monarchy of [Article] 155. And the Spanish state has been defeated.”

In an election that was free of incidents despite a highly emotional campaign, Catalans voted in unprecedented numbers, with a record turnout of nearly 82 percent, according to the provisional results.

Stephen Brown contributed to this article.