Rob Jetten's centrist-liberal party D66 are in a neck-and-neck race with anti-Islam populist Geert Wilders in the Dutch election, according to almost complete results.

With almost 99% of votes counted, both D66 and Wilders' Freedom Party were heading for 26 seats in the 150-member parliament, a projection from Dutch news agency ANP said on Thursday.

Initial exit polls had put Jetten in the lead. 'Millions of Dutch people have turned a page; they've said goodbye to a politics of negativity,' he told supporters.

A downbeat Wilders had earlier conceded the result was not what he wanted, having lost 11 seats, but said he had still achieved his second best result ever.

But as the final results trickled in on Thursday, the race became so close that the lead flipped between the two frontrunners.

Then, the last preliminary results came in from the capital Amsterdam and Rob Jetten's liberals moved significantly ahead by more than 15,000 votes.

Both parties were below 17% of the national vote, and three other parties were not far behind, including the conservative-liberal VVD on 22 seats, followed by the left-wing GreenLeft-Labour party and the Christian Democrats.

Wilders led the polls throughout the election campaign, but after he pulled the plug on his own coalition in June in a row over asylum and migration, all the mainstream leaders made clear they did not wish to work with him again.

He admits he has little hope of forming a government himself, but said on X on Thursday that if his party did top the vote he should have the first try. Even without a clear-cut victory, Jetten - who staged a remarkable campaign - would stand a stronger chance of leading the next administration.

Only a few weeks ago, the polls put D66 - a party formed by democratic reformers in 1966 - on just 12 seats.

But the photogenic, 38-year-old liberal leader capitalised on polished performances in a succession of TV debates and interviews.

The fact that he also competed in a TV quiz show called The Smartest Person in the weeks leading to the vote only added to his public profile.

Jetten was careful not to claim victory on Wednesday night, despite the party mood among his supporters.

The conservative liberal VVD of Dilan Yesilgöz was also heading for a successful night in third place and her party would be a good fit for any potential Jetten-led coalition.

Going into Wednesday's election, voters knew the result would be on a knife-edge, as five parties were in the running to win.

Wilders' PVV Freedom Party won 37 seats in November 2023, but many of those voters will have been put off by the realisation he would struggle to find parties to work with him again.

It took seven months for Wilders to reach a deal with coalition partners in 2024, only to bring down the government 11 months later.

Jetten made clear he was looking for a broad-based coalition that was both 'stable and ambitious', and he pointed out it was unprecedented for the winning party to score fewer than 30 seats in parliament.

He named the Labour-GreenLeft party of former European Commissioner Frans Timmermans as one potential coalition partner, along with Yesilgöz's conservative-liberal VVD and the revitalised Christian Democrats.

The exit poll spelt bad news for Frans Timmermans, whose left-wing party had long been second in the polls and is now set to come fourth.

But, he said, 'the losses could have been worse', given that Wilders had himself broken up the last coalition and had campaigned less actively than his rivals.

As D66 supporters celebrated in a venue in Leiden, Jetten noted, 'We did it - the best result D66 has ever achieved'.

Jetten's party plans to tackle the ongoing housing crisis, with plans to build new cities to accommodate the needs of a growing population. 'The Dutch are craving a prime minister who is able to unite the country and tackle the major challenges,' said one supporter.