Dutch PM Mark Rutte has warned his country not to succumb to a "domino effect" of populism that he linked to Brexit and to Donald Trump's election.
Mr Rutte was taking on his main rival, the controversial populist Geert Wilders, in a TV debate ahead of Wednesday's election.
Mr Wilders has pledged to take the Netherlands out of the EU, close all mosques and ban the Koran.
Some opinion polls suggest his Freedom Party could win the most seats.
That would hand him the first run at forming a coalition government, but the other parties contesting the election have ruled out working with the Freedom Party, making that an unlikely scenario.
Monday's televised debate was the first head-to-head between the two frontrunners, after Mr Wilders refused to take part in several previous debates.
The BBC's Anna Holligan in The Hague
Armed police swarmed round the university corridors outside the auditorium. Geert Wilders' public appearances are rare and always considered high risk. Students acting up as ushers handed out ice-cream wafers as the audience flipped down their seats.
This was the first chance to see Rutte versus Wilders, live and face-to-face. The firebrand populist looked uncharacteristically anxious to start, as Mark Rutte laid into him with warnings about playing party politics with the country's future.
But Mr Wilders soon found familiar territory accusing the prime minister of caring more about asylum seekers than his own people.
As the audience filed out afterwards, one member, tall and blonde, a quintessential Dutchwoman told us she had been disappointed by the tone. She feared their self-serving barbs would only deeper the divisions which have come to characterise this campaign.
When I ask her what constitutes the oft-cited "Dutch identity" she tells me, "it used to be tolerance, freedom and equality - but these men don't represent those things".
The two men clashed over a recent diplomatic spat with Turkey, which 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 said at the debate that Mr Rutte should have immediately expelled the Turkish ambassador. "Otherwise we accept that we are being insulted and our police are being insulted too," he said.
Mr Rutte's reply - that the remark showed the difference between "tweeting from the sofa and governing the country" - won him a sustained round of applause.
With two days to go until the election, one poll cited by Reuters suggested the Turkey spat, and subsequent riots by ethnic Turks in Rotterdam, had given anti-immigrant parties a boost.
The poll put the Freedom Party in second place behind Mr Rutte's VVD party. General polls suggest a significant number of Dutch voters are yet to make up their minds, meaning the debate could carry weight.
Mr Wilders does not shy away from controversy. He has vowed to ban Muslim immigration, shut mosques, and tax women who wear the Muslim headscarf, and in February he said some Moroccans were "scum".
Two months ago he was convicted of hate speech in a trial over a promise to reduce the number of Moroccans in the country.
Mr Wilders is highly unlikely to be able to form a government and so become leader, but a win for his party would be significant in the first European general election since Mr Trump became president in the US.
It would also foreshadow next month's presidential election in France, where far-right, anti-EU contender Marine Le Pen has widespread support, and September's election in Germany, where another right-wing party, Alternative for Germany, is likely to win seats for the first time.