Dutch voters have rejected a key European pact with Ukraine in a referendum seen as a barometer of anti-EU feeling, dealing an embarrassing blow to the government.

In a result swiftly hailed by eurosceptic groups, the Dutch news agency ANP said the "no" camp had won the day with 61.1 percent. Only 38 percent voted in favour of the two-year-old treaty with Kiev.

After initial doubts, ANP said that 32.2 percent of the electorate had turned out, meaning the ballot is valid and must be considered by the coalition government of Prime Minister Mark Rutte.

Dutch Ukraine referendum tests strength of anti-EU mood

"It looks like the Dutch people said NO to the European elite and NO to the treaty with Ukraine. The beginning of the end of the EU," far-right politician Geert Wilders said late on Wednesday.

Voters were asked if they supported the European Union's association agreement with Ukraine, which aims to foster better trade relations with the war-torn country and former Soviet satellite.

Ukraine to continue moving towards EU

Ukraine's President Petro Poroshenko said on Thursday that his country would continue moving towards the EU despite the resounding rejection.

Poroshenko downplayed the importance of the referendum but said Ukraine should "take it into consideration".

Many Ukrainian politicians feel their country deserves the treaty and are keen to show they have made progress in aligning their country with EU standards since the 2014 uprising that toppled pro-Russian president Viktor Yanukovich.

Bas Paternotte, a columnist for right-wing weblog GeenStijl, said Ukraine is not a suitable partner for the EU.

"That country is not ready," Paternotte told Al Jazeera. "It's sad for all those young people who fought for their freedom during the revolution but the country is a mess. Government-sponsored mobs are walking around with swastika flags; (President) Poroshenko has been named in the Panama Papers. Ukraine is unfinished," he added.

But organisers admitted the non-binding ballot was essentially about pushing a broader anti-EU agenda - humiliating at the very time that the Netherlands holds the rotating EU presidency.

Vote could boost far-right

The Dutch "no" poses a major headache for the European Union as it also gears up for the ramifications of a possible British exit from the bloc.

The Netherlands is now the only member in the 28-nation EU not to have ratified the Ukraine accord which has already been given the thumbs-up by both the upper and lower houses of the Dutch parliament.

Rutte agreed "the 'no' camp won convincingly".

And he was forced to concede that "if the turnout is above the [30 percent] margin then this accord cannot be ratified as is."

He had earlier urged voters to vote in favour of the pact with Kiev saying "we have to help Ukraine build up a judicial state and its democracy."

"Europe needs more stability at its edges."

It remains unclear what will happen next, with Rutte vowing a "step-by-step" approach in full consultation with the government and Brussels.

Official full results are only due on April 12.

The vote is non-binding. But it could mean that the coalition government - already under fire due to the refugee crisis - will seek to opt out of certain provisions of the EU-Ukraine deal to satisfy the voters.

It could also boost Wilders' Freedom Party, which is already riding high in the polls due to his stand against migrants.

'Sun setting on EU'

The leaders of the Netherlands' six largest parties all agreed on Wednesday that the country could not just ratify the agreement with Ukraine.

"The accord cannot just be ratified. We have to take into account this 'no' vote," said Diederik Samsom, the leader of the Labour Party, which is Rutte's junior ruling coalition partner.

The "no" camp had highlighted concerns about corruption in Ukraine and continuing separatist unrest in the east among reasons to refuse closer ties with Kiev.