THE HAGUE — The Dutch political establishment appeared Wednesday to fend off a challenge from anti-Muslim firebrand Geert Wilders in a national election, according to exit polls, a victory that heartened centrist leaders across Europe who are fearful of populist upsets in their own nations.

The result confirmed Wilders as a powerful voice on immigration in the Netherlands. But it would leave in place Prime Minister Mark Rutte and do little to alter the fundamental dynamic in a country unhappy with the status quo but deeply divided among many political parties.

The vote in the prosperous trading nation was seen as a bellwether for France and Germany, which head to the polls in the coming months and have also been shaken by fierce anti-immigrant sentiment. The British vote to exit the European Union and the election of Donald Trump, a skeptic about NATO and European integration, have cracked the door to a fundamental reordering of the post-World War II Western order.

But Wilders nose-dived in recent weeks after topping opinion polls for most of the past 18 months, as Dutch voters appeared to turn away from an election message that described some Moroccans as “scum” and called for banning the Koran and shuttering mosques.

Wednesday is “an evening where the Netherlands, after Brexit, after the American elections, said no to the wrong kind of populism,” Rutte told a cheering crowd in The Hague. He said he had already spoken to other European leaders to accept their congratulations.

But Wilders vowed to continue his fight.

“Rutte is far away from rid of me!!” Wilders wrote on Twitter shortly after the initial exit polls were released, embracing his role as more of a pest than a governing leader. Despite the disappointing result, he still gained seats, reconfirming his role as a thorn in the side of the nation’s mainstream leaders.

Outside Dutch borders, many leaders offered sighs of relief.

“Netherlands, oh Netherlands, you are the champions,” Peter Altmaier, the chief of staff to German Chancellor Angela Merkel, wrote on Twitter, echoing a Dutch soccer chant.

Taken together, the initial results appeared to show a nation that agreed that it disliked the current political situation – but had immense internal divisions about an alternative direction. With about a third of the vote counted early Thursday, the results were holding roughly steady. Rutte’s center-right People’s Party for Freedom and Democracy remained the largest party according to the exit poll, but it was on track to lose nearly a quarter of its seats in parliament, forcing the prime minister to form a new, broader coalition across the political spectrum.

Even as Wilders confronted limits to his ballot-box appeal, his agenda-setting power remained evident after many mainstream politicians tacked rightward during the campaign to advocate for stricter limits on immigrants.

“All the politicians of the main parties have been debating his issues, more than they’ve been debating other issues such as climate change,” said Sarah de Lange, a professor at the University of Amsterdam.