Voters in the Netherlands have rejected in a referendum an EU partnership deal to remove trade barriers with Ukraine.
Turnout was low, 32.2%, but above the 30% threshold for the vote to be valid. The deal was rejected by 61.1% of votes, compared with 38.1% in favour.
Prime Minister Mark Rutte said the government may have to reconsider the deal, although the vote is not binding.
Ukrainian President Petro Poroshenko insisted his country would "continue our movement towards the EU".
A foreign ministry official in Kiev told the BBC that the result was disappointing, adding that Dutch Eurosceptics could not take Ukraine hostage to express dissatisfaction with the EU.
The vote was widely seen in the Netherlands as a test of public opinion towards the EU.
It was triggered by an internet petition begun by Eurosceptic activists that attracted more than 400,000 signatures.
The result creates a headache for the Dutch government, as the Dutch parliament approved the EU association agreement with Ukraine last year. All the other 27 EU member states have already ratified the deal.
"My view is that if the turnout is more than 30%, with such a victory for the 'No' camp, ratification cannot go ahead without discussion," Mr Rutte said in a televised reaction. It is also an embarrassment for a Dutch government that currently holds the EU presidency.
Geert Wilders, who leads the anti-EU and anti-Islam Freedom Party, said the result was the "beginning of the end for the EU".
Officially the Netherlands has rejected a landmark deal between the EU and Ukraine - in reality the issues that dominated this campaign were much wider.
The referendum was triggered by the Eurosceptic movement, which used a new Dutch law designed to promote democracy to force a vote by gathering enough signatures on a petition.
From the start activists said this was a chance for Dutch voters to express frustration at the EU, in particular what they see as its desire to expand despite democratic shortcomings.
But they were not asked to simply pass judgement on the EU, and throughout the campaign those promoting a Yes vote were frustrated by what they saw as attempts by Eurosceptics to hijack a debate which should have been about relations between Ukraine, Russia and Europe.
Some say the multiple layers to this referendum mean the result cannot seen as a true reflection of the scale of Dutch Euroscepticism.
Nonetheless, the rejection of this deal will rattle the nerves of European leaders, who are already struggling to maintain unity in the face of economic instability and the migrant crisis.
Dutch vote cheers anti-EU camp
The vote comes less than three months before British citizens decide in their own referendum whether to leave the EU altogether.
A spokesman for campaign group Leave.EU, Brian Monteith, said: "This humiliating rejection of the Ukraine agreement demonstrates that people don't have to support the EU and its expansionist agenda to feel European."
Russian Prime Minister Dmitry Medvedev also appeared to welcome the result, tweeting that it was an indication of the European attitude to Ukraine's political system.
The Russian government was vehemently opposed to the EU deal with Ukraine and was widely thought to have pressed then-President Viktor Yanukovych to reject it in November 2013. Mr Yanukovych's decision prompted protests in Kiev that ultimately led to his downfall.
Pro-Russian separatists in eastern Ukraine have widely been blamed for the killing of 298 people, when a Malaysia Airlines flight from Amsterdam was shot down in July 2014. The Netherlands lost 193 of its citizens.
The Ukrainian president stressed the non-binding nature of the vote.
"I am sure that strategically this event is not an obstacle on Ukraine's path towards Europe," Interfax-Ukraine news agency reported Mr Poroshenko as saying.
Dutch Interior Minister Ronald Plasterk accepted the cabinet would need to consider the result but added that the government might need to look again at the 2015 referendum law that triggered Wednesday's vote. The minimum threshold could be based on the number of voters rather than the percentage, he suggested.
One of the Dutch Eurosceptics behind the referendum, Thierry Baudet, said there could be more votes in the future, covering the euro, open borders and any future EU trade deal with the United States.
EU Commission President Jean-Claude Juncker had described the stakes in the run-up to the vote as being high, warning that a No vote could trigger a wider crisis in the 28-member bloc.
"How will our politicians react if the outcome is a resounding no?" Ukraine's One Plus One TV asked as the polls opened.
In the run-up to the vote, Ukraine's media were abuzz with stories about various Ukrainian initiatives to promote the "Yes" campaign, including what they called an "invasion by propaganda troops" - local politicians and activists travelling to the Netherlands.
Many commentators in Ukraine are now wondering whether Kiev had done enough to counter the No campaign, whose efforts included the distribution of free waffles in wrappers with slogans urging the Dutch to vote against the agreement
Dutch voters have overwhelmingly rejected a Ukraine-European Union treaty on closer political and economic ties, in a rebuke to their government and to the EU establishment.
The broad political, trade and defence treaty – which had already been signed by the Dutch prime minister Mark Rutte’s government and approved by all other EU nations, and Ukraine – provisionally took effect in January.
But on Wednesday 64% of Dutch referendum voters rejected it; the turnout was just 32% – barely enough for the result to be valid.
Voters said they were opposing not only the treaty but wider European policymaking on matters ranging from the migrant crisis to economics.
Though the referendum was non-binding, Rutte acknowledged late on Wednesday it was politically impossible for his unpopular government to ratify the treaty in its current form.
However, as the Dutch currently hold the EU’s rotating presidency, he will need time to figure out whether and how he can alter the treaty in a way that could satisfy all parties.
Rutte said the government would consult with parliament and its European partners “step by step. That could take days or weeks.”
Ukraine’s president, Petro Poroshenko, said on Thursday his country would continue moving towards the EU despite the Dutch vote.
“Under any circumstances we will continue to implement the association agreement with the European Union including a deep and comprehensive free trade agreement,” he told reporters in Tokyo.
Russia’s prime minister, Dmitry Medvedev, said the result was “an indication of European attitudes to the Ukrainian political system”.
Any proposed changes to the treaty will have to pass both houses of the Dutch parliament, including the Senate, where Rutte’s shaky coalition lacks a majority. Some political commentators have predicted a coalition collapse over the issue, though new elections are due to be called by March 2017 anyway.
If a compromise can be found, it must also be palatable to other European countries, as well as the European commission and the Ukrainian government.
Rutte’s main political rival, the anti-EU, anti-Islam politician Geert Wilders, whose popularity has hit all-time highs amid Europe’s refugee crisis, said the result was “the beginning of the end” for Rutte’s government and the EU in its current form.
“If two-thirds of the voters say no, that is a vote of no confidence by the people against the elite from Brussels and The Hague,” he tweeted.
The European commission has said it will wait for the Dutch government to suggest a way forward.
Options include leaving the Ukraine agreement in force provisionally, or drafting exemption clauses for theNetherlands – as has happened in similar circumstances before.
Manfred Weber, leader of the centre-right European People’s party (EPP), the biggest bloc in the European parliament, and an ally of German chancellor Angela Merkel, said the referendum result was a “big defeat” for the Dutch government and should be taken seriously.
“We need to make Europe more democratic and transparent,” Weber told Deutschlandfunk radio, saying there was too much backroom politics going on in Brussels. He added that politicians needed to engage more with citizens, explain things to them and show that they take people’s concerns seriously.
He said that applied particularly to Britain ahead of the June referendum on the country’s membership of the EU..