Catalonia's ousted separatist leader, Carles Puigdemont, has declared that the Spanish state has been defeated in a snap regional election.
Speaking in Brussels where he is in self-imposed exile, Mr Puigdemont hailed the result as a victory for the "Catalan republic".
Separatist parties will hold a slim, reduced, majority in the new assembly.
However the Citizens party, which wants Catalonia to remain a semi-autonomous part of Spain, is the biggest party.
As a result, it is unclear who will be given the right to form a government.
The Spanish government imposed direct rule on Catalonia and called the election after declaring an October independence referendum illegal.
Prime Minister Mariano Rajoy had hoped the poll would restore stability but instead Spain's political turmoil looks set to continue. Mr Rajoy's conservative Popular Party (PP) recorded its worst ever result in Thursday's vote.
"This is a result which no-one can dispute," Mr Puigdemont said in a televised speech from Belgium.
"The republic of Catalonia has won... the Spanish state was defeated. Rajoy and his allies lost," he told cheering supporters.
With nearly all votes counted, the pro-independence parties Together for Catalonia (JxCat), Republican Left of Catalonia (ERC) and Popular Unity (CUP) were on course to win a total of 70 seats in total, giving them a majority in the new parliament.
Citizens (Cs) had 25.3% of the vote, winning 37 seats in the 135-seat chamber.
Its leader InÚs Arrimadas told the BBC her party had been "victorious". She said forming a coalition would be "difficult - but we will try".
The PP, meanwhile, won only three seats, down from 11 in the previous assembly.
Turnout was more than 80%, a record for a Catalan regional election.