The election the fourth in four years was necessitated after the governing Socialist Party (PSOE) fell short of a majority and was unable to form a coalition. Last elections were held in April.
The latest opinion polls showed that none of the parties was winning a majority. Instead, they showed the Socialists in the lead again, but with fewer votes than in April's election.
Spain has not had a stable government since 2015.
This election is being overshadowed by unrest in Catalonia and the rise of the far-right Vox party.
A total of 37 million eligible voters will elect the 350 lawmakers who will make up the next Congress, the lower House of Parliament, as well as 208 senators, reports Efe news.
Sunday's general election was the 14th since Spain's return to democracy under the 1978 Constitution.
Spaniards have a choice between the ruling Socialist Party (PSOE), the conservative Popular Party (PP), the centre-right Ciudadanos (Citizens, Cs), the left-wing Unidas Podemos (United We Can) and Spain's new far-right force Vox.
Other smaller and regional parties were also on the ballot papers.
Authorities have deployed 93,000 security agents across Spain, among them personnel from the National Police, Civil Guard and regional forces in Catalonia and the Basque Country, in order to ensure voter safety.
( With inputs from IANS )