A twist in Barcelona. After a surprise agreement with two rival political parties, the city council elected a new socialist mayor on Saturday June 17, breathing new life into Spanish Prime Minister Pedro Sanchez’s party ahead of the July 23 legislative elections.

The socialist candidate for mayor, Jaume Collboni, found himself in second place after the municipal and regional elections at the end of May, winning ten of the 41 seats on the municipal council of the great metropolis of Catalonia. But hours before the city council vote, the Barcelona en Comu party of outgoing left-wing mayor Ada Colau announced that its nine members would support Jaume Colllboni.

This initiative was supported by the People’s Party (PP, conservative) which holds two seats, which gives the new councilor a narrow majority of 21 representatives.

Although the Socialists and the PP were fierce political rivals, the Conservative party was not keen on Xavier Trias of the independence party Junts per Catalunya becoming mayor of Barcelona again. The former city councilor, between 2011 and 2015, was however the favorite, his party having come out on top in the elections of May 28, with eleven seats won.

After his swearing in, Jaume Collboni, 53, said he wanted to “be the mayor of everyone”. He therefore succeeds Ada Colau, a former housing rights activist elected to head a citizens’ platform supported by the radical left party Podemos, which notably made even more streets pedestrian-friendly and limited the opening of new hotels for trying to curb the excesses of mass tourism.

Polls indicate that Pedro Sanchez will have to fight hard in the July 23 snap elections to be re-elected.