Bill English has resigned as leader of the National Party, he made the announcement at a media conference this morning.
Follow RNZ's live coverage
Mr English accompanied by his wife Mary and family said now was the right time to step aside. He said he had informed caucus this morning.
He said the party would now go through its process of choosing a new leader which was likely to take a couple of weeks.
"My resignation will take effect on Tuesday 27 and I intend to deliver a valedictory speech on Thursday 1 March," he said.
Watch Mr English's full resignation speech:
He said he believed this would give the National Party time to pick a new leader and the best possible opportunity in the next election.
Although he said his decision to resign did not mean he could not have defeated Jacinda Ardern in 2020.
Reports emerged two weeks ago that some in the party were agitating for a change in command.
MPs had rallied behind Mr English at the party's annual caucus retreat more than a week later, as the party took stock of their election performance and plan for the year ahead.
Mr English said he was proud of his political career particularly his work in health, rebuilding the economy after the global financial crisis and helping to rebuild Christchurch.
Mr English said his steering of the country through the global financial crisis allowed New Zealand to make choices other countries could not.
"I've been fortunate to be able come to work everyday with a sense of mission and also to work with a team of people who shared that sense of mission."
In an often emotional announcement, he said the decision was purely personal.
"As a family we have lived with the demands of public service, your strength and tolerance has enabled my career. I now look forward to my new life together."
Prime Minister Jacinda Ardern paid tribute to Mr English.
"Bill has worked tirelessly as Prime Minister, Deputy Prime Minister, Finance Minister, and Opposition Leader among his many public roles. Very few serve for so long at such a high level, but garner the respect of many.
"I wish Bill and his family all the best for the future," she said.
Mr English entered parliament in 1990 as the MP for the Wallace (now Clutha-Southland) district.
He served as a health minister, treasurer and finance minister before being appointed the party leader in 2001. After National's election defeat in 2002 he was replaced as party leader by Don Brash the following year.
Following National's victory in 2008 he was appointed as finance and deputy Prime Minister, and took over the leadership from John Key when he stood down in December 2016.