National Party leader John Key has won a decisive victory in the 2008 general election, with 59 seats in Parliament.
Conceding defeat, outgoing Prime Minister Helen Clark announced she was standing down as Labour leader.
Deputy leader Michael Cullen also announced later he was standing down from the position.
Mr Key addressed hundreds of his party faithful in Auckland, telling them there will be a new National-led Government.
The incoming Prime Minister said the result shows New Zealanders have spoken in their hundreds of thousands and called for change.
He said New Zealand had voted for a safer, more prosperous and ambitious New Zealand.
Mr Key said he is looking forward to leading the country, despite the challenges it faces.
National will be able to form a new Government with the support of ACT and United Future. New Zealand First was not returned to Parliament this term.
Labour leader Helen Clark congratulated John Key in a speech to supporters at Labour Party headquarters in Auckland.
Miss Clark said she accepted the choice the public had made, and accepted responsibility for the election result.
She then announced she was standing down and expected Labour colleagues to elect a new leader before Christmas.
Miss Clark, who retained her Mt Albert electorate, earlier telephoned John Key to concede the election.
Michael Cullen is also standing down as deputy leader. He said on Sunday it was time to step aside as the party rebuilds.
Dr Cullen said he would continue to serve in Parliament.
National secured 45.5% of the party vote to Labour's 33.8%.
The results would give a potential National-led Government, with ACT and United Future, 65 seats in Parliament.
Labour would have 43 seats, the Green Party eight seats, the Maori Party five and United Future and Progressive one each.
ACT leader Rodney Hide won the Epsom electorate and his party gained 3.7% of the party vote.
United Future leader Peter Dunne, who would also line up with a National government, retained his Ohariu seat.
Mr Dunne said he planned to use his power in Parliament to moderate potential extremism in the new Government.
The Green Party gained 6.4% of the party vote, which would give it eight MPs.
Co-leader Jeanette Fitzsimons told about 200 supporters gathered in central Auckland the results give them a stronger voice in Parliament.
She also said she wonders whether in 20 years' time people will look back on this election and say they're glad they voted for tax cuts rather than the future of their children.
New Zealand First was on 4.2%, below the 5% threshold to get back into Parliament without winning an electorate.
Party leader Winston Peters failed to regain Tauranga, which was won by National's Simon Bridges, and conceded defeat in a speech at his party headquarters.
The Maori Party won five of the seven Maori seats, and has 2.2% of the party vote.
The election was New Zealand's fifth under the MMP system.