Dutch Prime Minister Mark Rutte Thursday strengthened his election win over rival anti-Islam MP Geert Wilders, as with almost all votes counted his party was credited with 33 seats.
Wilders celebrated too however as his far-right Freedom Party looked set to emerge the second largest in the 150-seat parliament, with a total of 20 MPs.
According to Dutch news agency ANP, with some 97 percent of votes counted, Rutte's Liberal VVD party had moved ahead from the exit polls issued in the immediate hours after Wednesday's ballot.
His win was eight seats down from the 2012 polls when his party won 41 seats.
But it will put Rutte in pole position to form the next coalition government, with party leaders set to get down to talks soon.
Wilders also boasted of his party's success as he has added five seats since the 2012 elections.
"We were the 3rd largest party of the Netherlands. Now we are the 2nd largest party. Next time we will be nr. 1!" he tweeted.
Earlier predictions had the PVV sharing second place with the Christian Democratic Appeal (CDA) and the Democracy party D66.
But the ANP calculated that they were both just pushed into joint third behind Wilders with 19 seats.
The burning question was now what would be the fate of Wilders and his PVV.
Wilders said early Thursday he was prepared to work with the new government if asked, but Rutte along with most party leaders have vowed to snub him. That would leave Wilders as the largest party in opposition.
The CDA and D66, long-established Dutch parties which have often been in government, would be natural partners for Rutte to form a centre-right coalition.
Watch Rutte on election night:
The three parties combined would have a total of 71 seats and would need a fourth to reach the 76 needed for a majority.
Millions of Dutch flocked to the polls in a near-record turnout, with the stakes high in an election pitting the pro-European Rutte against his anti-immigration and anti-EU rival.
"This was the evening when The Netherlands, after Brexit and the American elections, said 'stop' to the wrong kind of populism," Rutte told cheering supporters.
"Now of course it's important to unite the country in the coming weeks and months and that we succeed in forming a stable government for the next four years," he added.
Relieved European leaders, fearing the rise of anti-EU sentiment in one of the bloc's founding members, congratulated Rutte, now headed for a third term at the head of the one the eurozone's largest economies.
A spokesman for EU Commission chief Jean-Claude Juncker hailed it as a "vote against extremists" while one senior European source told AFP on condition of anonymity: "Common sense strikes back."
Foreign Minister Jean-Marc Ayrault of France, where the far-right Marine Le Pen is currently seen winning the first round of the presidential election in April, congratulated Rutte for "stopping the rise of the far-right".
Wilders' much hoped for 'patriotic spring' did not eventuate. (EPA/ROBIN UTRECHT) Source: EPA/ROBIN UTRECHT
'Not rid of me yet '
Wilders had pledged to close the borders to Muslim immigrants, shut mosques, ban sales of the Koran and leave the EU if he won the polls.
He thanked his supporters in a message on Twitter, with his party set to boost its number of MPs to 19. The PVV won 15 seats in the 2012 elections, which had slipped to 12 in the outgoing parliament.
"We won seats. The first gains are made. And Rutte is not rid of me yet," he said.
Eyeing weeks, if not months, of protracted coalition talks ahead, Wilders offered early Thursday to work with the new government.
RELATED READING
Dutch PM slaps down far-right challenge: exit polls
"I would still like to co-govern as the PVV, if possible. But if that doesn't work ... we'll support the cabinet, where needed, on the issues that are important to us."
Watch: SBS News Europe correspondent Brett Mason at the VVD election party
Most of the other leaders, including Rutte have vowed not to work with Wilders, denouncing his incendiary rhetoric and his go-it-alone attitude.
Turnout reached 81 percent, just shy of the record of 88 percent set in 1977.
Rutte appeared to have benefited from his firm stance in a spiralling diplomatic spat with Turkey after authorities barred Turkish ministers from rallying support in the Netherlands for a referendum.
Watch: The Dutch election explained