National MP Andrew Falloon resigned after sending an inappropriate image to a young woman, Newshub understands.
It was Prime Minister Jacinda Ardern who found out about the incident, which involved alcohol. An email was sent to her, which she passed on to National leader Judith Collins.
In a statement on Monday, Falloon said he had been dealing with "unresolved grief" following the recent suicide of a friend. He said, "I have made a number of mistakes and I apologise to those who have been affected."
Collins also put out a statement on Monday saying Falloon is "suffering from significant mental health issues".
Falloon had always aspired to be an MP and in 2017 won the seat of Rangitata. But less than three years on and he has quit, with a reference to a tragic time in his past.
"When I was in my late teens and early twenties three of my best friends took their own lives in tragic circumstances," he said in his speech. "I'm sorry that I couldn't do more for them. It's a feeling that doesn't go away."
In his statement on Monday, Falloon went on to say, "It was an extremely difficult period in my life. Unfortunately, recently, another friend took their own life, which has brought back much unresolved grief."
He then says he's made a number of mistakes and apologised to those affected.
One of those affected contacted the Prime Minister's office last week, detailing inappropriate, drunken behaviour.
"I was sent some correspondence. It was received by my office. I was advised of the general nature of that correspondence," Ardern said on Monday at her post-Cabinet press conference.
The Prime Minister's Office passed on the email to National's leader Judith Collins last Friday.
"I believe that once my chief of staff was notified he dealt with it immediately," Ardern added. "I believe there might've been something like 48 hours."
It was Collins' third day on the job - she was in Auckland unveiling National's transport policy.
In her statement on Monday, Collins said she dealt with the issue, which sounds distinctly like she pushed Falloon out.
National Party deputy leader Gerry Brownlee told Newshub, "I was just notified that he was intending to resign and I read the press statement."
National sent support with Falloon as he made his way back from Wellington to his mid- and south-Canterbury electorate on Monday afternoon.
It's an electorate whose MP has quit 61 days out from the election.
"Absolutely shocked, to be honest," a local man told Newshub. "He's done a damn good job."
Another local said she was shocked by the news.
"I'm actually shocked and very sad because I feel like he's done a lot for our area."
Outside of his electorate, Falloon was best known for a viral cat tweet when his dad was crook.