Here's a look at the main candidates vying to take office: PEDRO SÁNCHEZ Sánchez, the Socialist party leader and incumbent prime minister, is aiming to pull off yet another unexpected political turnaround.
He was forced to call an early election when his minority government failed to pass a national spending bill in February. Now, all polls forecast that the Socialists will overtake the conservative Popular Party to garner the most votes on Sunday, but it will be nowhere near a majority.
That would be another surprising victory for the 47-year-old former basketball player who temporarily lost his party leadership in 2016 in an internal spat following two crushing defeats in consecutive national elections.
But rank-and-file party members took back Sánchez as the Socialists' general secretary in mid-2017 and a year later he engineered a stunning maneuver and became prime minister, forcing his predecessor, Mariano Rajoy, to face a no-confidence vote over corruption cases tainting the Popular Party.
PABLO CASADO Casado is facing his first election as head of the Popular Party, Spain's dominant conservative political force for the past three decades. The 38-year-old lawyer, who has made most of his career in politics, took over as party chief in July vowing to clean up party corruption with a zero-tolerance approach.
Casado has been dragging the party toward more conservative ground and calling for a stronger stance on Catalan separatism. The goal is to prevent a flood of votes going to the center-right Citizens party, perceived as tougher on the Catalonia issue, and the far-right Vox.
ALBERT RIVERA The 39-year-old Rivera is anything but shy. A university debate champion and water polo player in his youth, Rivera made his debut in politics in 2006 at age 27 by posing nude for a campaign poster.
He has since led Citizens. It began as a tiny party in Barcelona, created to fight the local Catalan secessionist movement, and it has now spread across Spain. Presenting himself as a champion of the free market, Rivera's party has tried to carve out a space in the center of Spanish politics, enticing voters from both the Socialists and the Popular Party.
Citizens' newcomer status is now threatened by the upstart Vox, which is also luring conservative voters. PABLO IGLESIAS Iglesias was tipped to lead a leftist takeover of Spain in 2015. Now, the ponytailed former TV politics commentator is struggling to keep his far-left United We Can party from breaking apart.
United We Can has been wracked by in-fighting among its leaders and the polls show it may pay a heavy price. After returning from paternity leave to care for his premature twins he had with party No. 2 Irene Montero, the 40-year-old Iglesias is trying to rekindle the indignation of the jobless and those most hurt by austerity measures.
Sánchez may need to rely on Iglesias for support in a coalition. SANTIAGO ABASCAL Abascal is the scion of a family targeted by the now-defunct separatist group ETA in his native Basque region. He made his career as a member of the Popular Party and now hopes he and others from his Vox party will become the first far-right lawmakers to sit in parliament since the 1980s.
The platform of Vox, which means voice in Latin, is to defend Spain from what it says are the dangers of separatism, Muslim immigration, feminism and liberals. The 43-year-old Abascal unapologetically defends hunting, bullfighting and traditional and Catholic family values.
He has said that he wants to "reconquer" Spain, a reference to the 15th-century expulsion of Muslims and Jews from Spanish territory. The pistol-carrying politician has called for dropping strict gun controls.