More than 77% of those who cast ballots voted "yes", according to the poll for Spanish TVE television.
The Ipsos poll, released when polls closed at 8pm local time (1900 GMT), showed between 77% and 80% of those who cast ballots were in favour, while 15% to 17% were opposed. Spoiled ballots accounted for 5-6%.
Turnout was between 40% and 42%.
"The 'yes' camp have clearly won by a crushing margin. It's not a surprise," Pierre Giacometti, Ipsos' director-general, said.
Earlier, voting got off to a poor start, with experts warning that a low turnout would deflate the European project.
Spain was the first of the European Union's 25 nations to hold the referendum to accept a new constitution, a document designed to simplfy the EU's decision-making process.
Barometer of mood
The vote, which asked the basic question "Do you approve the treaty instituting a constitution for Europe?", was widely expected to be a "yes" vote for Europe, with the Spanish government of Jose Rodriguiz Zapatero strongly endorsing it.
A lower turnout would have been an admission that knowledge and enthusiasm for Europe is something that does not stir Spaniards' passions.
The 'yes' camp won by a crushing
margin, according to the exit poll
They have been grateful for the two main benefits of EU membership: political stability and billions of pounds of structural funds, which have allowed Spain to modernise its roads for instance.
Socialist Prime Minister Zapatero struck an urgent note as he tried to drum up interest by reminding Spaniards - with expensive advertising campaigns - that they have benefited to the tune of £60bn since joining the EU in 1986.
Spanish people were bombarded with leaflets as they board trains, queue at supermarkets and wait at doctors' surgeries.