The Socialist candidate in Valladolid, Óscar Puente (center), will sit in the mayor's office thanks to a leftist alliance. R.GARCIA / EFE

Half of Spain’s major cities could end up with left-wing governments after last Sunday’s municipal and regional elections, in which the conservative Popular Party (PP) lost many of its absolute majorities.

Of the 52 provincial capitals, only Soria (population 40,142) has one dominant party in the city council, and that is not the PP but the Socialists (PSOE).

The conservatives have lost the 30 absolute majorities they earned in 2011, when the Socialists were dealt a crushing defeat at the polls for their perceived mismanagement of the economic crisis.

The arithmetic of the election outcome means leftist coalitions could take around 30 municipalities from the Popular Party

But this time around, and despite a slight economic recovery, the emergence of new political groups has created a fragmented political scenario in which nobody can claim complete control of city councils or regional assemblies.

Faced with the need for alliances, leftist forces are reaching deals to ensure one of their own sits in city halls even in municipalities where the PP was the most-voted force.

This kind of coalition could give the left control over at least 27 provincial capitals. It has already happened in Valladolid, where a three-way deal has prevented PP incumbent León de la Riva from being reinstated, and given the key to City Hall to the Socialist Óscar Puente.

The PP secured the most votes in 37 municipalities, while the Socialists were the most-voted force in six cities, with another six going to regional parties in parts of Spain with strong nationalist sentiment, such as the Basque Country and Catalonia. Blocs backed by anti-austerity party Podemos earned the most voter support in two capitals, Barcelona and A Coruña.

The arithmetic of the election outcome mean that leftist coalitions – the Socialists, United Left and the Podemos-backed blocs – could take around 30 municipalities away from the PP. And that is without counting the possibility of added support from Ciudadanos, a new party that made a strong showing on Sunday and could play the role of kingmaker in several councils and assemblies.

Its leader, Albert Rivera, has stated that he is ready to reach deals with any party – except for regional nationalists – as long as it is the most-voted force and accepts his own anti-corruption conditions.

With investiture sessions scheduled for June 13, all parties are now scrambling to reach the kind of deals that will afford them the greatest possible power.