The Netherlands' centre-right Prime Minister Mark Rutte roundly saw off a challenge by anti-Islam, anti-EU Geert Wilders in an election, early returns showed.
The result is a huge relief to other EU governments facing a wave of nationalism.
"It appears that the VVD will be the biggest party in the Netherlands for the third time in a row," Mr Rutte told cheering supporters at a post-election party in The Hague.
"Tonight we'll celebrate a little."
Mr Rutte received congratulatory messages from European leaders and spoke with some by telephone.
"It is also an evening in which the Netherlands, afte rBrexit, after the American elections, said 'stop' to the wrong kind of populism," he said.
With nearly 11% of votes counted, Mr Rutte's VVD Party was projected to win 32 of parliament's 150 seats, down from 41 at the last vote in 2012, but ahead of Mr Wilders who was in third place at 20 seats, according to data provided by the ANP Dutch news agency.
At 81%, turnout was the highest in 30 years in an election that was a test of whether the Dutch wanted to end decades of liberalism and choose a nationalist path by voting for Mr Wilders and his promise to "de-Islamicise" the Netherlands.
In the city of Nijmegen, polling stations had to order extra ballot papers and extend opening times to give people enough time to vote.
The result was a relief to mainstream parties across Europe, particularly in France and Germany, where right-wing nationalists hope to make a big impact in elections this year.
German Chancellor Angela Merkel's chief of staff, Peter Altmaier, tweeted: "The Netherlands, oh the Netherlands you are a champion!..... Congratulations on this great result."
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.
But while Mr Rutte averted what in the early stages of the campaign looked like a possible victory for Mr Wilders, years of austerity pushed down his share of the vote.
His junior partner in the outgoing coalition, Labour, suffered its worst ever result, winning just nine seats, down from 38 last time.
That means it may take weeks or months for Mr Rutte to negotiate a ruling coalition.
We need your consent to load this rte-player contentWe use rte-player to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences
Mr Wilders, whose Party for Freedom (PVV) is projected to increase its parliamentary seats to 20 from the 15 won in 2012, tweeted: "We won seats! The first victory is in! And Rutte has not seen the last of me yet!!"
The result is well down from his 2010 high of 24 seats while support for the two most pro-EU parties, the progressive D66 and GreenLeft, were way up.
Using a sports metaphor, Mr Rutte had called the vote a European quarter-final, before a French semi-final and a 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.
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.