A small pro-independence party will play a key role in determining the next government of Catalonia after a massive boost in support at regional elections.
The Republican Left's Josep Lluis Carod is now the kingmaker
Elections on Sunday in Spain's largely autonomous province left no single group with an absolute majority.
But the Republican Left made huge gains and is expected to start talks on Monday with the two leading parties.
The governing conservative nationalists won 46 of the province's 135 seats, with their rivals, the socialists, winning 42.
The Republican Left, which advocates independence from Spain, almost doubled its representation to 23 seats, with more than 16% of the vote.
This leaves the party in the position of kingmaker, as its support is now crucial to form a coalition government.
The Republican Left's candidate for regional president, Josep Lluis Carod, declined to say which party he might team up with.
"We want the strongest pro-Catalan government possible," he told a crowd of cheering supporters in Barcelona.
CiU conservatives 46 - down 10
Socialists 42 - down 8
Republican Left 23 - up 11
Popular Party 15 - up 3
Greens 9 - up 4
The Socialist Party of Catalonia candidate for president, Pasqual Maragall - whose party had led in opinion polls - expressed disappointment, but portrayed the results as a victory for the broad left.
His party, together with the Republican Left and the greens, would have enough seats to govern.
Neither of the leading parties advocates independence - but both want to overhaul relations with the central government.
Pujol is retiring after more than two decades
After 23 years in power, regional president Jordi Pujol, of the Convergencia i Unio (CiU) coalition, is retiring.
The BBC's Katya Adler, in Madrid, says many Catalans though feel their identity is now threatened by immigration - mostly from North Africa and South America.
More than 80% of Catalans use their regional language in their everyday lives and the majority say they feel Catalan rather than Spanish.
One in four immigrants to Spain head for this wealthy province.
But human rights groups say the role the immigration debate has played in the run-up to elections is not a sign of anti-immigrant sentiment.
Rather, in Catalonia, it is seen as part of a determined effort to remain culturally distinct from the rest of Spain.