Spaniards are voting in a landmark election that will see more than two parties compete for power for the first time in decades.
Newcomers Podemos, an anti-austerity party, and Citizens, a liberal party, are challenging the ruling Popular Party (PP) and the Socialists.
Opinion polls have suggested PM Mariano Rajoy’s PP is narrowly ahead.
While he has been in power, Spain has emerged from a financial crisis into a period of economic growth.
The conservative PP currently has a majority in Spain’s lower house of parliament.New parties Citizens and Podemos are fielding national candidates for the first time.
The BBC’s Tom Burridge in Madrid says both look set to take a large chunk of the vote, ending the power monopoly of Spain’s traditional heavyweights.
It is almost certain that no party will get a majority of MPs in parliament, our correspondent says, meaning some form of coalition will have to be agreed.
Polling stations opened at 09:00 local time (08:00 GMT) and close at 19:00 GMT. Exit polls are expected minutes afterwards and complete results are due two days later.
Return to growth
The economy, corruption allegations and a separatist drive in the prosperous north-eastern region of Catalonia have been the dominant issues in the election.
Pablo Iglesias, 37, university lecturer, leader of new anti-capitalist party Podemos: “The problem isn’t Greece, the problem is Europe. Germany and the IMF are destroying the political project of Europe”
Pedro Sanchez, 43, academic, leader of established Socialist party (PSOE): “The head of the government, Mr Rajoy, has to be a decent person, and you are not”
Albert Rivera, 36, lawyer and former competitive swimmer, leader of new Citizens (Ciudadanos) party: “They [Podemos] blame the system – we blame the people who have corrupted the system”
Mariano Rajoy, 60, prime minister and leader of established, conservative Popular Party: “Who today is talking about bailout Spain? No-one”
Corruption dominates debate
New faces in politics
New political era
Mr Rajoy’s administration adopted unpopular austerity measures and job reforms that have been credited with returning the Spanish economy to growth.
However, unemployment remains high at 21%, the second-highest rate in the EU after Greece, although it has fallen from its 2013 peak of 27%.
The PP has also been damaged by corruption scandals.
The central government in Madrid has also had to contend with an attempt by Catalonia to break away from the rest of Spain.
Pro-independence parties in Catalonia won an absolute majority in regional elections in September and a month later passed a motion to begin the process of declaring independence.
Spain’s Constitutional Court has revoked that motion, but Catalonia’s leaders said they would ignore it.
Mr Rajoy has vowed to quash the threat to Spanish unity, but other parties favour negotiations to devolve more power to the region, which accounts for about a fifth of Spain’s economic output.
Mr Rajoy has also raised questions about his future by including his deputy, Soraya Saenz de Santamaria, on campaign posters and fielding her in his place during a leaders TV debate.
His campaigning has also not been easy – a teenager punched him in the face during a visit to the town of Pontevedra in the north-west. – BBC NEWS