Opponents won 52.8 percent of the vote to 47.2 percent in favour, on turnout of 82.5 percent — the highest since 2009.
Early results had pointed to a narrow lead for pro-EU voters in Reykjavik, but rural votes swung the result the other way once counted on Sunday morning.
Prime Minister Kristrún Frostadóttir told a press conference that her government "is not going forward with accession talks with the EU this term," and that Iceland will continue to strengthen economic relations with the European Union..
She had previously said that in the event of a 'no' vote, the issue would not be revisited before parliament's term ends in 2028.
The country was deeply split on the question.
Supporters hoped EU membership would bring lower interest rates and inflation, as well as cheaper goods.
Also, they pointed to US President Donald Trump's threats to take control of Greenland as reason to move closer to Europe.
Opponents, including farmers and the fishing and whaling industries, argued it would undermine Iceland's sovereignty and lead to stricter fishing quotas.
Opposition parties, including the conservative Independence Party, also opposed it.
Iceland applied to join the EU in 2009, at the height of the financial crisis, but talks were frozen in 2013 over eurozone concerns.
It is already closely tied to the bloc through the European Economic Area, though this excludes agriculture, fisheries, monetary policy and security.
Iceland is also part of the Schengen area, allowing people to travel freely between member countries without going through border controls.
(ał)
Source: PAP