The Socialist PSOE was the clear winner in Sunday's general election, gaining 123 seats of the total of 350 in the Spanish Congreso, a large increase on its previous 84 seats and just as the opinion polls had been predicting.
The result was short of the 176 overall majority needed to govern alone but combined with the 42 seats obtained by the left-wing group Unidas Podemos, and the support of some of the minority regional groups, PSOE leader Pedro Sánchez is seemingly within easy reach of keeping his job as prime minister.
Split on the right
The other big news of election night was the dramatic decline in the number of seats of the conservative Partido Popular (PP). This was the first election for leader Pablo Casado who said the results had been "very bad" for his party. The party fell from 137 seats in the last election in 2016 to 66 last Sunday - its worst ever result.
Analysts blamed a split in the right-wing vote, with radical newcomers Vox gaining 24 seats, the first time they have been in parliament. Their final seat count was, however, less than many commentators had been expecting.
Centre-right Ciudadanos (Cs), under Albert Rivera, saw their seats shoot up to 57, which was 25 more than in 2016. This was just a few seats short of taking over the PP as the second-largest party and official opposition.
Sánchez decides next step
The PSOE leader will now hold a series of meetings with the leaders of the PP, Cs and Unidas Podemos looking to secure the support of their MPs in an investiture vote in the Congreso. The Congreso and the Senado (the upper house) must meet again on 21 May but there is no time limit on MPs then voting on a new government.
Sánchez's deputy, Carmen Calvo, said this week that rather than forming a coalition to secure an absolute majority, the Socialists preferred to rule as a minority government, just as they have been doing until now with just 84 seats since Sánchez ousted the PP's Mariano Rajoy in last year's vote of no confidence.
Although some big business was calling for the PSOE to go into coalition with Cs this week, Albert Rivera had already ruled out a pact with the PSOE during the election campaign. This leaves Unidas Podemos, the left-wing alliance of Podemos and Izquierda Unida, as the likely kingmaker, even though they did worse than in 2016. Leader of Podemos, Pablo Iglesias, said on Wednesday that he wouldn't allow the PSOE to govern in minority and that he would demand places in the Cabinet in a coalition government.
"There's not going to be a one-party government in Spain. The Spanish have said so, not us," explained Iglesias.
After the May elections
Sánchez is due to meet Casado on Monday, followed by Rivera and Iglesias on Tuesday. The PSOE has said it will wait until after the next elections on Sunday 26 May to form a government. Then, votes for town halls across the country take place as well as for the European parliament. There are also votes in most of Spain's autonomous regions. Sánchez doesn't want any pacts to influence his party's support in those elections.
Sensing voters in the 26 May elections may warm to a less right-wing PP, Pablo Casado has been toughening his rhetoric on Vox this week.
In Sunday's election, the winning PSOE received 29 per cent of the vote, followed by the PP on 17 per cent, Cs on 16 per cent, Unidas Podemos on 14 per cent and Vox 10 per cent. Other regional parties made up the difference.
There was also a surge in separatist left-wing MPs being returned from the Basque Country (with Bildu) and from Catalunya (with the ERC).
Voting also took place in the Senado. Here the PSOE won an overall majority of 121 in the 208-seat upper chamber - a result driven by the split of the right-wing vote. The PP had held a majority here for 23 years.
Valencia votes too
Sunday also saw the separate early election for the devolved parliament covering the Valencia region. Here the PSOE of regional leader Ximo Puig increased by four seats to 27 while their Podemos-affilated partners in government, Compromis, dropped two regional seats.