The centre-right PP looks set to be the biggest party again, with around 120 seats, but its most natural potential coalition partner, the liberal Ciudadanos ("Citizens"), looks likely to win only about 40 seats, leaving them well short of the 176 needed for an absolute majority.
Yet the rise of Unidos Podemos ("Together We Can"), a far-left alliance led by Podemos, could in theory offer a way out.
The 90 seats it is expected to win, combined with around 80 for the Socialist Party (PSOE), would come close to an overall majority. Support from some of the regional parties could then allow them to form a government.
Many analysts believe, however, that the 137-year-old Socialist Party would prefer to form a 'grand coalition' with the People's Party (PP) of the current acting prime minister, Mariano Rajoy, or give passive support to a minority PP government, rather than get into bed with a group that threatens their existence. [nL8N19D1L9]
The situation has echoes of Greece, where a long-established centre-left party, PASOK, joined a conservative-led government in 2012, only to find itself subsequently humiliated by the rise to power of the far-left Syriza party -- which is close to Podemos.
After Britain's vote to quit the EU, Greece's Syriza prime minister, Alexis Tsipras, and Podemos leader Pablo Iglesias called for a relaunch of the European Union based on improved democracy, social protection and solidarity.
"It's bad news for the future of Europe. We are very worried about the decision of the British people. And we think we need to reconstruct another idea of Europe based on social rights and human rights," Iglesias told journalists on Friday as he closed his campaign.
It is not clear which impact the result of the British referendum will have on the Spanish election. Some analysts say Spaniards may opt for a "safe option" by backing the traditionally dominant PP and PSOE, while others say it is likely to translate into a boost for the insurgent Podemos.
There are also doubts about how many Spaniards will turn out to vote again, six months after an election that produced only political bickering, and with summer holidays starting.