People wait in queue to cast their votes at a polling station during Spain's general election in Madrid. Photograph:( Reuters )
Opinion polls have tipped the 47-year-old socialist prime minister, Pedro Sanchez as the winner but without the majority, he will need to govern.
From the youthful conservative hardliner to the pony-tailed far-left former professor, the cast of candidates challenging Spain's socialist Prime Minister Pedro Sanchez represents the country's changing political landscape.
Here are the five main candidates locking horns in Sunday's election.
Opinion polls have tipped the 47-year-old socialist prime minister as the winner but without the majority, he will need to govern.
After having led the Socialist Party (PSOE) to one of its worst ever scores in the 2016 election, Sanchez took power in June from then conservative prime minister Mariano Rajoy, toppled by a no-confidence motion.
Sanchez's minority government was supported by a motley crew -- far-left Podemos, Basque nationalists and separatist lawmakers from Catalonia, the northeastern region rocked by a failed secession bid in 2017.
But the trained economist was forced to call early elections after Catalan lawmakers refused to back his 2019 budget.
Leading an executive with the highest number of female ministers in Spanish history, Sanchez scored big in Europe soon after taking office by accepting to take in 630 migrants rescued by the Aquarius charity ship.
After years of devastating austerity, he also increased the minimum salary by 22 per cent.
In July, the 38-year-old became the conservative Popular Party's (PP) youngest ever leader.
In charge of the party's communications under Rajoy, the law graduate has steered the PP further to the right.
After December regional elections in southern Andalusia, his candidate leapt to power with the support of centre-right Ciudadanos and far-right party Vox, chasing the socialists from their traditional stronghold.
If a similar alliance took shape after Sunday's election, Casado -- who has waged an aggressive campaign against Sanchez, accusing him of betraying Spain for talking with Catalan separatists -- could become the youngest Spanish prime minister in history.
But opinion polls estimate the PP won't do well, caught as it is between Ciudadanos and Vox.
The pony-tailed former politics professor is looking for a new lease of life for his far-left Podemos party which contributed to the end of two-party politics in 2015 along with Ciudadanos.
Born from the Indignados anti-austerity movement that shook Spain during the economic crisis, Podemos would like to forge a coalition with the socialists.
But the party has been weakened by internal divisions, and opinion polls estimate it will only get half the parliamentary seats it won in 2016.
Iglesias himself has also been hit by a controversy over a luxury villa the 40-year-old bought last year with his partner Irene Montero, deputy leader of Podemos.
The centre-right Ciudadanos leader from Barcelona with a liberal economic and social programme fiercely defends the unity of Spain in the face of separatists in his native Catalonia.
The 39-year-old's Ciudadanos entered the national parliament with a bang in 2015, pledging to wipe out the traditional left-right divide.
Rivera, who has since veered more to the right, now refuses any potential alliance with Sanchez if the latter wins after having tried -- and failed -- to enter a coalition with him in 2016.
He has instead reached out to the PP.
A former PP member who grew up in the northern Basque Country under the constant threat of separatist group ETA, Abascal has created a stir with his far-right party Vox.
Opinion polls say his ultra-nationalist party could get more than 10 per cent of votes in a country with no far-right to speak of until now.
Largely unknown until several months ago, Abascal has benefited from his hardline stance against Catalan separatism.
Making regular headlines with controversial proposals, the 43-year-old criticises traditional media and has used social networks hugely for his campaign.