Voters in the Netherlands appear to have narrowly rejected new online data collection powers for intelligence agencies in a referendum.
With about 90% of votes counted, 48.8% have rejected the powers, with 47.3% in favour.
An exit poll by the national broadcaster had earlier suggested a victory for "yes".
Supporters say the powers could help fight terrorism, while opponents say the law could be invasion of privacy.
Prime Minister Mark Rutte promised to take the vote seriously. Although the result is non-binding a no-vote would need to be taken into account by the government.
What are the Dutch voting on?
The Netherlands put to a referendum new legislation, officially the Intelligence and Security Law.
The bill gives new powers to the Netherlands' intelligence services.
They would be able to install wire taps on whole areas, rather than just individuals, store information for up to three years and share this data with other spy agencies.
An independent panel would have to approve these wire taps before they could go ahead.
Both the lower and upper chambers of the Netherlands parliament passed the law last year, but a "no" vote would force them to re-debate it.
The referendum coincided with municipal elections around the country.
Why the controversy?
From its introduction, opposition politicians, legal experts, civil rights organisations and journalists have come out against it.
There are complaints the powers go too far, could be a violation of privacy and do not have enough oversight.
A lawsuit is reportedly in progress claiming the new powers break human rights laws, while Amnesty International has condemned the law in its annual report on the country.
But Mr Rutte has insisted the spy agencies need these new powers to help fight terrorism.
"It's not that our country is unsafe, it's that this law will make it safer," he said.
Intelligence services head Rob Bertholee said: "This law is for the safety of the Netherlands and for the Dutch people... I am voting in favour."