The Socialist party of departing Prime Minister Pedro Sanchez was leading Spain's election as polls closed on Sunday, a survey by Gad3 showed shortly after mainland voting ended.
The survey showed no single party close to winning a parliamentary majority. Far-right group Vox was winning lower house seats, making it the first such party to sit in Spain's Parliament since 1982.
Spaniards cast their votes in close to record numbers in the most highly contested election for decades, and one likely to lead to months of negotiations to form a government in a bitterly divided Parliament.
This is the third national election in four years. The first two eroded the decades-long dominance of the two biggest parties, the Socialists and the conservative Popular Party. Another election is a real possibility.
A splintered vote followed by long talks to form an administration is becoming a recurrent theme in European politics as voters reject traditional parties for new groups often at the extremes of the political spectrum.
In recent Spanish elections, early evening opinion polls conducted under a different method failed to give an accurate picture of the outcome.