The election pits those hungry for change in a country with high unemployment against those who fear it would torpedo Spain's slow economic recovery.
Britain's shock vote to leave the European Union has further exacerbated this division.
The outgoing conservative Popular Party (PP) is insisting on the need for "stability" in the face of "populism" - a thinly-veiled dig at the Unidos Podemos coalition.
Voters have the choice between four major political groupings after the emergence of Podemos and centre-right upstart Ciudadanos last year uprooted the country's two-party dominance.
The December general election resulted in a 350-seat parliament so splintered that parties failed to agree on a coalition, and this is what has prompted Sunday's repeat vote.
Opinion polls - conducted pre-Brexit - suggested the results Sunday would also be fractured, with the PP coming first without a majority, tailed by Unidos Podemos, which could replace the 137-year-old Socialist party as Spain's main left-wing force.
If so, political leaders will have to go back to the negotiating table, under more pressure this time to form a coalition.
'Country can't wait'
Throughout the campaign - and again on Friday after Brexit - the PP has hammered away at the need for stability in reference to the rise of Unidos Podemos, which like Greece's ruling Syriza party rejects EU-backed austerity and pledges to fight for the least well-off.
The coalition, led by charismatic, pony-tailed Pablo Iglesias, has responded with a message of calm aimed at defusing this criticism.
Unidos Podemos - the "o" of Unidos shaped as a heart - has run an emotional campaign.
Iglesias said Spain needed a coalition government of Podemos and the Socialists as he cast his ballot at a high school in Vallecas, the working class neighbourhood in southern Madrid.
He said Podemos would "sooner or later govern in Spain", adding that he hoped it would be now "because the country can't wait".
Rajoy has argued that since the PP came to power in 2011, it has brought Spain back to growth and overseen a drop in unemployment - though at 21 percent it is still the second highest rate in the European Union after Greece.
But his rivals retort that inequalities have risen, the jobs created are mainly unstable, and they point to the repeated corruption scandals to have hit the PP.
In the latest case, Interior Minister Jorge Fernandez Diaz was caught on tape talking to an anti-fraud official, apparently discussing how to incriminate his political rivals - an incident Rajoy shrugged off as a "farce".
'Prefer devil I know'
The Socialist party (PSOE), meanwhile, is going through what analysts call its worst crisis in decades as Podemos gnaws away at its support base, with some voters disillusioned with what they see as a staid party that has strayed from its working-class roots.
"The PSOE isn't left-wing anymore, I want deep, general change, and Unidos Podemos is the only one that can do this," said one such disappointed voter, Jonatan Mora, a 31-year-old physiotherapist.
"We've been through some horrible years. I want all the corrupt to be chased out, social issues to be taken into account and citizens listened to."
Whether Brexit will have any influence on Spain's election is as yet uncertain, though analysts say people may turn to established parties that represent a safe pair of hands.
Luis Fernandez, a 37-year-old community organiser, said he had voted for the Socialists in the past but would vote for Rajoy this time around.
"I prefer the devil I know than the devil I don't know," he said at Madrid's El Rastro flea market.
More than 36 million Spaniards were eligible to vote in the poll.
Voter turnout at 2 pm (1200 GMT) was 36.87 percent, virtually identical to the same time in the last elections on December 20th, 2015, the interior ministry said. The first official results will be known around 2030 GMT.
By Marianne Barriaux / AFP