The anti-Islam MP Geert Wilders has conceded defeat and declared Prime Minister Mark Rutte as the winner of pivotal parliamentary elections in the Netherlands.
Mr Rutte's centre-right VVD Party is projected to win 31 seats in the 150-member parliament - 12 more than Mr Wilders' Freedom Party, which is in a three-way tie for second.
Mr Rutte said his message has resonated and sends a clear signal to others.
Mr Rutte's centre-right party was vying with the anti-Islam Mr Wilders' Freedom Party, with at least seven of the 28 parties contesting the election predicted to gain a significant number of seats.
The result will be a relief to mainstream parties across Europe, particularly in France and Germany, where right-wing nationalists are set to make a big impact in elections both will hold this year.
Mr Rutte got a last-minute boost from a diplomatic row with Turkey, which allowed him to take a well-timed tough line on a majority Muslim country during an election campaign in which immigration and integration have been key issues.
Dutch proportional representation means up to 15 parties could win a parliamentary seat and it could take months for Mr Rutte to build a coalition.
Mr Rutte had called the vote a European quarter-final, before a French semi-final and German final, and warned voters that a Wilders victory would be "the wrong sort of populism winning the day".
The far-right Marine Le Pen is set to make the second-round run-off of France's presidential election in May, while in September's federal election in Germany, the right-wing, eurosceptic Alternative for Germany is likely to enter the national parliament for the first time.
Mr Wilders had pledged to take the Netherlands out of the EU, close all mosques and ban the Koran.
"Whatever the outcome of the elections today, the genie will not go back into the bottle and this patriotic revolution - whether today or tomorrow - will take place," he declared after casting his vote.
After casting his vote, Mr Rutte asked his fellow citizens to imagine how the world would react if the Freedom Party came first.
"I think the rest of the world will then see that after Brexit, after the American elections, again the wrong sort of populism has won the day," he said.
Leaders clash on immigration
Earlier, in televised debates, Mr Rutte and Mr Wilders clashed over how to stem immigration.
Mr Rutte dismissed Mr Wilders's plan to close borders and mosques and to ban the Koran as "fake solutions".
Mr Wilders accused Mr Rutte of providing better healthcare for immigrants than for the Dutch themselves.
The Freedom Party (PVV) had been leading in opinion polls but they have since suggested his support may be slipping.
Seven of the 28 parties running could win more than 10 seats in the 150-seat parliament, the polls suggest.
While a populist surge is still possible in the Dutch ballot, a host of other parties could also do well, leaving Dutch politics fragmented, the BBC reports.
Several of the smaller party leaders are being seen as potential power-brokers, but none are likely to take part in a coalition with Geert Wilders.
How important is the Turkish factor?
The row with Turkey followed Mr Rutte's decision to ban two Turkish ministers from addressing rallies in the country. In response, Turkish President Recep Tayyip Erdogan accused the Netherlands of being "Nazi remnants".
Mr Wilders described protesters who rioted outside the Turkish consulate in Rotterdam at the weekend as "scum".
One opinion poll suggested that the spat, and the riots in Rotterdam, had given anti-immigrant parties a boost but other polls indicated that the government's tough response to the rallies would benefit Mr Rutte's party too.
What does the vote mean for the rest of the EU?
With the sixth largest economy in the EU, the Netherlands is at the heart of the eurozone and EU decision-making.
Its reputation as a beacon for liberal values and tolerance in Europe has come under question with the rise of the Freedom Party.
Analysts say a strong showing for Mr Wilders could foreshadow next month's presidential election in France, where far-right, anti-EU contender Marine Le Pen has widespread support.
In Germany, another right-wing party, Alternative for Germany, is expected to win seats for the first time in September.
- BBC / Reuters