THE pollsters had it right and with 99.99 per cent of the votes counted, the PSOE were the most-voted party.
The socialists headed by the current president Pedro Sanchez won 123 seats in the national parliament but will need pacts with other parties to govern.
The Partido Popular, the PSOE’s closest rivals lagged further behind than expected with 66 seats and the party under Pablo Casado suffered its worst-ever defeat.
His hard-hitting, far-right strategy backfired and the PP’s showing in Cataluña was abysmal, taking just one seat in Madrid and none in the Basque region.
Ciudadanos and Albert Rivera did better by poaching enough PP voters to win 57 seats but did not manage to overtake the PP as ambitious Rivera had hoped. Unidos Podemos lost seats but the 42 they secured was a better result than the pollsters predicted and these will be vital to Pedro Sanchez if he is to form a government.
Extreme right-wing Vox, the party that every other party feared for different reasons enters the national parliament for the first time with 24 seats although Santiago Abascal had hoped to win twice that number.
The Esquerra Republicana de Catalunya (ERC) pro-independence party doubled their seats in the national parliament to 15, while PNV and Bildu in the Basque Region also gained seats.
There was a record turnout of almost 76 per cent, nine percentage points more than in the 2016 general election.
It is already clear that the PP, Cs and Vox cannot repeat their Andalucia coalition and Albert Rivera ruled out a post-election alliance with the PSOE weeks go.
So Pedro Sanchez must now look Left to form a government and also woo the nationalists, possibly including ERC, to obtain the 176 seats he needs to govern.
• PSOE – 123
• PP – 66
• CIUDADANOS – 57
• PODEMOS – 42
• VOX – 24