David Clark has formally resigned as Health Minister after recent controversies in his handling of the Covid-19 response.
He has been under pressure since the start of the government's response to Covid-19 some months ago.
He said the portfolio had been a challenging one and it was clear to him that he was becoming a distraction from the government's response to the pandemic.
"I've always taken a view that the team must come first ... so I've made the call that it's best for me to step aside."
Prime Minister Jacinda Ardern said she had accepted his resignation.
"David has come to the conclusion his presence in the role is creating an unhelpful distraction from the government's ongoing response to Covid-19 and wider health reforms," Ardern said in a statement.
"It's essential our health leadership has the confidence of the New Zealand public. As David has said to me the needs of the team must come before him as an individual."
Chris Hipkins has been appointed as minister of health until the elections. Ardern said she had full confidence he would "oversee the portfolio with the thoroughness and diligence".
"Post-election I intend to reassess who is best placed to take the health portfolio forward."
But National deputy leader Nikki Kaye has expressed scepticism about Hipkins' ability to juggle both health and education.
"New Zealanders need to have absolute confidence that the health portfolio, given the bungles that have occurred around border management, is being managed well ... and I'm not confident that Chris Hipkins will be able to do that with both education and health."
Missed the announcement watch it back here:
At his announcement, Clark said with the focus shifting to tackling the virus at the border, this was the right time to move on.
"I have made the decision myself and I genuinely think now is the right time.
"It's important we get the response right and I don't want to be a distraction to that response."
He thanked health professionals who had been putting themselves at the frontline during the pandemic and New Zealanders' sacrifice during the various alert levels.
"Despite more than 80,000 tests in the last two weeks alone, we have no evidence of community transmission ... we are now in a more stable footing... Now is the right time to handover the reins and move forward with new leadership."
He said it had been a rewarding three years and he was proud of all his team had achieved in that time.
"But it has not all been smooth sailing, and I wish to put it on the record again I take full responsibility for the decisions made and taken during my time as minister of health."
He reiterated his support for Dr Bloomfield and thanked him for his extraordinary efforts during Covid-19.
Clark first came under fire during the pandemic when it was revealed he took a trip to a beach with his family in the first week of level 4 lockdown. Although he offered to resign at the time, the prime minister reprimanded and demoted him but did not sack him.
The Dunedin-based MP also admitted to a second breach, after driving to a mountain biking track during lockdown.
Jacinda Ardern said under normal circumstances she would have sacked him.
More recently he faced a backlash after repeatedly saying Director-General of Health Dr Ashley Bloomfield was the person responsible for failures at the border, and only taking responsibility himself as minister after several days.
Talking about his comments on Bloomfield and whether that was the reason for his resignation, Clark said: "I've always been clear that I have a deep respect for Ashley Bloomfield and we have a good warm working relationship."
"The important thing is the whole context of my admiration for his work... I'm grateful for the work he and his team have done."
Clark will continue to serve as an MP and says he remains committed to the Labour Party and will ask for people's support in the coming elections.