Bill English has stepped down as National Party leader.
English made the announcement at a press conference at Parliament with many MPs standing behind him. HIs wife Mary and sons were also there.
He told caucus of his decision this morning.
English said he had been reflecting over summer on his decision, and would embark on "new personal and professional challenges".
He would resign and leave Parliament on February 27 to give National's new leader the time to prepare for 2020.
English said it had been a privilege and honour serving in Parliament for the past 27 years.
English said his proudest achievements included social investment and handling the New Zealand economy through the Global Financial Crisis.
He thanked the public for the support they had given National, and thanked his colleagues and the National Party.
"I've been fortunate to be able to come to work every day with a sense of mission.
"To our supporters, thank you for keeping the faith through nine years of successful government and through that change of government."
English got emotional when thanking his family, saying their "strength and tolerance" enabled his career.
Resigning was not a concession of defeat to Labour leader Jacinda Ardern, he said, and he believed National could be successful in 2020. "I'm handing over the party in as strong a position as it could be."
English will remain leader until his resignation takes effect on February 27. He would not say who his preferred successor was.
The decision to resign crystallised over summer, a time English said was the first time in a long time he had not faced political concerns. He said his family had spent most of their lives with the demands of politics, and he had decided he wanted to give them some time without it.
Deputy Paula Bennett and finance spokesman Steven Joyce learned of his decision a week ago.
English said his caucus had done him "an enormous favour" by allowing a clean handover after former Prime Minister John Key quit and he hoped the handover from him would be as tidy.
English had not told caucus his decision at the retreat last week because he had not wanted to distract from the main aim of that meeting, which was strategy and political development, he said.
He also said he would cast a vote on the leadership. "And I look forward to them coming to me to ask for it after years of having to ask for it myself."
Asked at what clear moment he had decided to go, he joked it was "sitting on the couch at Dipton looking out at the scenery and thinking 'wouldn't it be great if I didn't have to answer media questions?'"
"What matters in politics is you be satisfied yourself with what you do."
There had been "ups and downs", he said, but no regrets.
Although he was given Key's endorsement, he had decided it was for caucus to pick the new leader.
As for the future, English said he would pursue personal and business interests.
"I"m pretty open to all those opportunities."
Asked if a return to farming was possible, he replied: "I'm certainly going to spend more time back in Dipton. Whether they would think my skills were useful and relevant is another question."
English said he had told caucus that what National had over the past decade was "not normal in politics" and they should strive to maintain that stability. He said tearing itself apart was "a recipe for staying in Opposition".
He hoped the economy would stay strong and Labour would not dismantle the social investment approach, identifying and targeting the vulnerable in society.
He said he did not want to prejudge whether a change of leader would make it easier for National to deal with NZ First or other possible support partners in 2020.
Robert Muldoon was in Parliament when English entered and it was a "rambunctious" place "in which the leader of NZ First thrived". He said such instability and lack of discipline would be fatal for a party today.
National MPs including English's close friend Nick Smith, deputy leader Paula Bennett and front bench colleagues Anne Tolley, Gerry Brownlee and Steven Joyce were alongside English as he made his announcement.
Of the likely leadership contenders, only Judith Collins managed to fit into the room - Simon Bridges was in Tauranga because of travel delays.
Prime Minister Jacinda Ardern praised English and wished him well.
"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," Ardern said.
"He has always stood for what he believes in. He is a man of clear convictions who has always had a genuine concern for the well-being of New Zealanders, and gave a huge portion of his working life to serving on their behalf.
"The impact of public service on a politician's family cannot be understated. In the 27 years Bill served as an MP, with the support of his wife Mary, his children were born, and grew up. They have made great sacrifices so he could do his job to the best of his ability.
"I wish Bill and his family all the best for the future."
Australian Prime Minister Malcolm Turnbull told Australian Parliament today that Bill English is a "great New Zealander".
"Bill English did an outstanding job as Finance Minister and Prime Minister. He is a great friend of Australia. The job they did in New Zealand is something that has been an example to us."
Former Prime Minister Helen Clark wished English and his family all the best in a post on social media.
Maureen Pugh is next on National's list and is expected to return to Parliament as an MP.
A former Westland mayor, Pugh served as an MP in the previous term when she replaced senior minister Tim Groser, who left to take up the role as Washington ambassador.
Pugh thought she had made it back to Parliament on election night last year but lost her spot after the special votes were counted.
She attended last week's National Party caucus meeting in Tauranga and said she would take up the chance to return to Parliament if a position came up.
Bill English's full speech
"It's been an enormous privilege to serve New Zealanders since being elected to Parliament in 1990.
"Over 27 years I have been privileged to work alongside so many people to improve our country. I am proud of the innovative work done as a Health Minister in the 90s, and then as Finance Minister through the GFC, helping to stabilise and grow the economy and to rebuild Christchurch.
"In recent years I enjoyed the development of Social Investment and new ways of the Crown working with Māori to make a real difference, and I was honoured to lead New Zealand as Prime Minister.
"National's two-day caucus meeting last week confirmed to me that our team has the talent, the ideas and the energy to return to government in 2020. It's important that National's new leader has the time and the best possible opportunity to achieve that.
"So I believe now is the right time to step aside and to embark on new personal and professional opportunities.
"I've served with some outstanding politicians and I want to thank my Parliamentary colleagues and the National Party for the trust and support they have given me.
"I'm also indebted to the people and communities of Clutha-Southland - and before that Wallace - who sent me to Parliament and kept me grounded for so many years.
"To our supporters, thank you for keeping your faith in us through nine years in Government, and through the change of government. I know that our MPs will continue to represent your ambition for New Zealand.
"Most importantly I would like to thank my family. Mary and our children, Luke, Thomas, Maria, Rory, Bart and Xavier.
"For all our time together we have lived with demands of public service. Your strength and tolerance has enabled my career. You have been my inspiration and pride and I now look forward to a new life together."