Preliminary results early on Thursday morning gave caretaker Prime Minister Mark Rutte's centre-right Liberals 41 seats in the 150-member lower house, a slender two-seat lead over the centre-left Labour Party on 39 seats, with over 80 percent of votes counted.

With only about 100,000 votes difference, neither party claimed victory, but analysts said the Liberals appeared to have won.

The hard-left Socialists, who oppose austerity and euro zone bailouts, finished a distant third and gained no ground, while the far-right anti-immigration Freedom Party of Geert Wilders, who campaigned to leave the euro and the European Union, slumped and was set to lose about a third of its seats.

The two radical parties had dominated early stages of the campaign, raising the prospect of a massive protest vote that might paralyse government and make Dutch support for further euro zone bailouts impossible.

The unexpectedly clear result removed a potential obstacle to efforts to stabilise Europe's single currency after Germany's constitutional court gave the green light for the euro zone's permanent bailout fund to go ahead.

However, the Netherlands is likely to remain an awkward, tough-talking member of the single currency area, strongly resisting transfers to euro zone debtors, even if the two main parties end up forming a coalition.

If confirmed, the outcome makes it more likely that Rutte, with the strongest international profile, will remain premier.

TWO-HORSE RACE

The campaign ended up as a two-horse race between Rutte, 45, a former Unilever human resources manager dubbed the "Teflon" prime minister because of his ability to brush off disasters, and energetic new Labour leader Diederik Samsom, 41, a former Greenpeace activist whose debating flair impressed voters.

A beaming Rutte told jubilant supporters in Scheveningen it was too early to claim victory, even though the Liberals were on course to win the largest number of seats in their history.

The caretaker prime minister, whose minority centre-right government was toppled by Wilders in April out of hostility to spending cuts to cut the budget deficit, vowed earlier to pursue his tough policy on euro zone bailouts in alliance with fellow northern creditor countries Germany and Finland.

Labour's Samsom laid claim to a place in government and called for national unity.

"Many did not believe that in such a short period, the Netherlands would return from the politics of populism to honesty, by saying that hard times mean hard choices," he told supporters.

"We owe it to the voters to work together. This country is not seeking polarisation in the next five years, but togetherness. Not division, but unity," Samsom said.

Wilders, who suffered a stunning defeat after bringing down the government and shifting his message from anti-Islam to anti-euro, vowed to bounce back.

"Our fight in the Netherlands is needed now more than ever. These problems will only get bigger and the best years for the PVV lie ahead of us," the firebrand told supporters. "I will not quit."

The centrist Christian Democrats, who dominated most post-war Dutch governments until the mid-2000s and were junior partners in Rutte's outgoing cabinet, crashed to their worst result in decades and were tied for fourth place with the Freedom Party in the exit polls.

"It looks like there is going to be a tectonic shift in the political landscape," outgoing Christian Democratic interior minister Liesbeth Spies said on NOS television.

POLITICAL FRAGMENTATION

The Liberals and Labour have played down talk of forming a coalition together. But parliamentary arithmetic suggests that is the most probable outcome given the highly fragmented political landscape.

"They are condemned to work with each other. It shows the Dutch people want a stable government," said Andre Krouwel, a political scientist at Amsterdam's VU University.

The Netherlands is one of the few triple-A rated countries left in Europe and a long-standing ally of Germany in demanding strict adherence to EU budget rules.

Dutch taxpayers are frustrated at demands for belt-tightening, especially the steady erosion of their cherished welfare state and pensions, while having to put up billions of euros to rescue what they see as profligate budget sinners.

"People have become negative about Europe because we give so much money to Greece and other countries, and at the same time we are aware of the fact that we badly need money here to pay for schools, for the army and everything," said Jaap Paauwe, a professor of management at Tilburg University.

With the focus on the euro zone crisis and its impact on the domestic economy, Europe took centre stage during the campaign, pushing immigration off the radar after nearly a decade.

Business groups ran a campaign highlighting the benefits of EU membership. The main employers' federation hung a banner from its head office proclaiming: "Vote for Europe and your job."

(Additional reporting by Svebor Kranjc in Leiden, Christian Levaux in The Hague, Gilbert Kreijger and Thomas Escritt in Amsterdam; Editing by Paul Taylor and Stacey Joyce)