Madrid, Spain (CNN) -- Spain's Socialist Prime Minister Jose Luis Rodriguez Zapatero suffered a political reversal on Sunday when his party sank in elections in the powerful northeast region of Catalonia, around Barcelona.
With national elections due in little more than a year, many analysts saw the vote as a warning for Zapatero in the midst of Spain's deep economic crisis. Spain's unemployment rate is running at almost 20 percent.
Voters in Catalonia rejected the Socialist-led coalition that has governed the prosperous region of seven million for seven years. They returned to power the center-right Catalan Convergence and Union (CiU) coalition that had previously ruled for 23 years.
CiU was just shy of a majority in the 135-seat regional parliament, winning 62 seats, to the Socialist Party's 28 seats, with 99.7 percent of the ballots counted, according to official results announced in Barcelona.
Jose Montilla, the defeated incumbent Catalan president, called on the CiU leader Artur Mas to form a government. Mas would need support for investiture and key legislation from smaller parties. Another CiU leader, Josep Antoni Duran I Lleida, said Mas would be the next Catalan president.
While immigration, more home-rule powers and even potential independence from Spain were among hot issues in the regional elections, many in Catalonia and especially elsewhere in Spain were watching closely for voter discontent with Spain's economic crisis.
Catalonia accounts for about 14 percent of Spain's population but nearly 19 percent of national GDP.
The vote came after a week in which debt-ridden Ireland accepted a financial rescue. International markets then stepped up pressure on Spain's debt-ridden neighbor, Portugal. That's raised fears anew that Spain, also suffering a large deficit, might also seek a bailout, which Zapatero has repeatedly denied.
Zapatero campaigned vigorously alongside the incumbent, Montilla, trying to convince Catalan voters that the Spanish government's austerity measures and labor reforms were helping pull the nation, slowly but surely, out of the economic crisis.
Montilla announced after the results he would step down from the Catalan Socialist party leadership.
In Madrid, Marcelino Iglesias, a senior leader of the Socialist party nationwide, said it shared some responsibility in the defeat of the Catalan Socialists because of voter dissatisfaction over the economic crisis.
Elections are due next year for some other Spanish regional parliaments and in all municipalities. In the past, strong slides by the governing national party in those local elections have portended a change of power at the top.