The Labour Party leader David Shearer says he is resigning because he no longer has the confidence of a number of his caucus colleagues.
Mr Shearer says he will step aside as leader as soon as his replacement is selected, which could take up to a month.
Mr Shearer delivered a short statement to reporters at 1.30pm on Thursday then left Parliament without answering any questions.
He says he will remain the MP for Mt Albert and will give the new leader his full support.
His deputy, Grant Robertson, is not ruling out a bid for the leadership.
One of the other main contenders, David Cunliffe, also says he will consult with colleagues and party members before declaring his hand.
Another MP, Andrew Little, is also not ruling out putting himself forward.
Prime Minister John Key says he has some sympathy for Mr Shearer as he was a nice guy, but he clearly didn't have his party behind him.
He says the leadership issue doesn't inspire public confidence in the Labour Party .
Caucus support lacking
He will officially resign when a new leader is confirmed after a contest expected to take three to four weeks. Nominations for the leadership open in 48 hours.
Mr Shearer told reporters it's time for someone else to take over.
"It's been my privilege to lead the Labour Party for the last 20 months, and I'm proud of the gains we've made in that time, but we need to do more and we haven't had the lift that we had been wanting.
"My sense is that I no longer have the full confidence of many of my caucus colleagues."
Mr Shearer said there was no letter asking him to go nor a no-confidence vote.
Party whip Chris Hipkins also said there was no challenge for the leadership to spark the resignation.
Mr Shearer, 56, was elected to Parliament at a by-election in 2009 and became party leader in 2011.
He previously worked for the United Nations for almost 20 years.
Senior National Minister, Gerry Brownlee, said David Shearer is fundamentally a decent man, but he has walked a pretty difficult tightrope between the left and right factions of the Labour party.
"When you've got a party that is factionally divided like that it is pretty hard to get widespread leadership support.
But it's going to be interesting to see how they sort out that left-right divide when the economy is clearly going in a good direction."
Green Party co-leader Metiria Turei is surprised at the timing of Mr Shearer's resignation.
She said he is very brave to resign as leader, rather than be removed.
Shearer could have been brilliant - Goff
Former Labour Party leader Phil Goff says David Shearer could have been a brilliant Prime Minister and he may have some regrets about what could have been
Mr Goff, who stood down after losing the 2011 election, says the role of leader of the Opposition is the toughest job in Parliament and Mr Shearer has made a courageous decision in resigning.