Opinion polls show the Socialists in the lead but likely to win slightly fewer seats than in April's vote.
Spain held its second parliamentary election in just over six months on Sunday, with voters likely to deliver an even more fragmented parliament with no clear winner and a sizeable showing by the far-right.
Opinion polls show the Socialists in the lead but likely to win slightly fewer seats than in April's vote, while the conservative People's Party (PP) could gain strength and the far-right Vox could become the country's third-largest party, just months after winning its first parliamentary seats.
Spain has been struggling to put stable governments together since 2015, when new parties emerged from the financial crisis following decades during which power oscillated between the Socialists and the PP.
Acting Prime Minister Pedro Sanchez called the election - the fourth in four years - betting that a new vote would strengthen his hand after his Socialist Party won in April but then failed to forge the alliances needed to form a government.
Sanchez avoided questions on Sunday about a likely political stalemate.
"Democracy is the best heritage of our parents and we must make the most of it ... I encourage Spaniards to vote and strengthen democracy with our vote," he said after voting in the town of Pozuelo de Alarcon, just west of Madrid.
Voting will end at 8 p.m. in mainland Spain. Results should begin emerging in the early evening, with almost all votes counted by midnight.
Esperanza de Antonio, a 64-year old retired history teacher voting in Madrid, said she had changed her vote from the center-right Ciudadanos to the Socialists after the disappointment of seeing no political deal reached after April's ballot.
"In the last election I voted for Ciudadanos because I thought it would be kingmaker, but ... Ciudadanos did not abstain to facilitate a government," she told Reuters.
"The rise of Vox is a danger to democracy. I'm saying this because I’ve taught about fascism for 30 years," she added. Older Spaniards still remember first-hand the dictatorship of Francisco Franco, who ruled from 1939 to 1975.
A minority government led by the Socialists appears the most likely outcome, opinion polls show, but an even bigger question is who the Socialists may ally with and how long any government can last with a very fragmented parliament.
Many voters were still undecided days before the vote, meaning other scenarios are also possible.
Polls suggest that support for Vox could as much as double, even if pollsters have struggled to estimate the new party's popularity.
The overall result is likely to be very close, leaving the door open to several possible configurations or even a repeat election.
In total, more than 92,000 police will be deployed across Spain to safeguard the vote.