Voters in the economically powerful region of Catalonia have punished the leader who made a referendum over breaking away from Spain a central plank of his campaign, seeing his party's majority reduced by a dozen seats.
Regional president Artur Mas called the early election as part of a power struggle with prime minister Mariano Rajoy regarding the size of Catalonia's contribution to national coffers. But what began as a quarrel over money turned into a test of Spain's territorial integrity.
Mr Mas had asked the electorate to give him an absolute majority to lend weight to his Convergence and Union party's centre-right policies, including the call for a referendum. But voters have left him 18 votes short and in need to make a coalition to guarantee staying in power.
His party now has 50 seats in the 135-seat regional legislature. The second-most voted party is pro-referendum Republican Left, which has been very critical of Mr Mas' austerity drive.
"The vote is fragmented but the message is clear," said Ferran Requejo, political science professor at Barcelona's Pompeu Fabra University. "Two-thirds of the electorate voted for parties that are in favour of calling an independence referendum, but Mr Mas has been hit hard for his austerity policies."
Mr Mas appeared on television to thank his party for its support and to acknowledge that they could no longer rule alone as a minority government. He also said that those who think the referendum plan had been aborted needed to do the maths.
"Those who want to abort the process should take into account that they have to know how to add and subtract because the sum of the political parties in favour of the right to choose form a great majority in parliament," he said.
Two pro-unity parties - Mr Rajoy's Popular Party and the Catalan Ciutadans - did make modest advances, boosting their seats by seven to 28. "For those who want a Catalonia outside Spain, matters have got worse," PP spokeswoman Maria Dolores de Cospedal said.
Catalonia is responsible for around a fifth of Spain's economic output and many residents feel the central government gives back too little in recognition of the region's contribution.
Catalans have said during growing public protests that their industrialised region is being hit harder than most by austerity measures aimed at avoiding a national bailout like those needed by Greece, Ireland, Portugal and Cyprus.