New Zealand's ruling National Party won the largest number of votes in the country's general election on Saturday, securing a comfortable margin over the Labour Party after what had promised to be the most hotly contested race in recent history.

National and Labour had been almost neck and neck in opinion polls, with charismatic 37-year old Jacinda Ardern almost single-handedly dragging Labour back into the race after taking over the party's leadership in August.

National took 46 percent of the vote, the Electoral Commission said, while support for Labour was 35.8 percent. A final tally including overseas votes will be released on Oct. 7.

The results set up the nationalist New Zealand First Party to hold the balance of power and form the next government with 7.5 percent of the ballot.

Veteran New Zealand First leader Winston Peters has been minister under both major parties and has not said which party he would favour as a coalition partner. Previously he has backed the party with the largest number of votes.

All party leaders said they would have conversations over the next few days, with some of them already trying to woo Peters on election night.

"I want to acknowledge the strong performance of Winston Peters and New Zealand First," Bill English said in a speech to his supporters.

"The voters of New Zealand have given New Zealand First a role in forming the next government," he said.

For English, who campaigned heavily on National's economic credentials after taking the party leadership last year, the strong showing was a vindication after National crashed to its worst ever election result in 2002 under his first stint as leader.

Opinion polls leading up to the vote had been volatile with two recent ones giving National a near 10 point lead over Labour. National has been in power for nearly a decade.

"Bill English and National have taken the largest number of votes. I've called Bill and acknowledged that," Ardern told her supporters, adding she was planning conversations with both the Green and New Zealand First parties. "It's not over yet."

Peters sounded buoyant but kept his cards close to his chest.

"We have been strong enough and honest enough with our supporters to make it home," he said. New Zealand First had "not all the cards but we do have the main cards," he added, saying he would not be rushed into giving any answers immediately.

"SPECIAL VOTES"

Ardern and English were expected to maintain fiscal prudence, but to differ on monetary policy, trade and immigration. That would likely have implications for the New Zealand dollar, the world's 11th most-traded currency in 2016. The New Zealand dollar has tended to rise when National rose in the polls.

"The thin trading conditions typical of early morning in Asia mean a sharp but short-lived move on the NZD is possible on Monday," said Joseph Carpuso, senior currency strategist at CBA.

New Zealand uses a German-style proportional representation system in which a party, or combination of parties, needs 61 of Parliament's 120 members - usually about 48 percent of the vote - to form a government.

The results secured 58 seats for National in parliament, and 45 for Labour. New Zealand First has nine seats and Greens, which won 5.8 percent of the votes, have seven.

National's 58 seats were higher than Labour and Greens put together at 52, but neither combination had enough to govern on their own.

"It's all over, bar the special votes - but even they won’t change the basic maths. They won't change any crucial seats and National is extremely unlikely to go up. So Winston Peters rules," said Bryce Edwards, analyst at Wellington-based Critical Politics.

A record 1.2 million ballots were cast before the day of the election, accounting for about a third of the 3.3 million New Zealanders enrolled to vote.

"Special votes", which include ballots from New Zealanders overseas and those who vote outside their home constituencies, will be released on Oct. 7. These are estimated to represent 15 percent of total votes and could have a considerable impact.

"I would expect us to get a bit of a lift out of those special votes," said Ardern.