Trevor Mallard has been appointed New Zealand's next Ambassador to Ireland and will leave the role of Speaker on Wednesday.
In a statement, the Speaker's office said Mallard "has advised the Governor-General of his resignation with effect from 1:45pm tomorrow (Wednesday)".
"The Governor-General has accepted the resignation."
Mallard tweeted the response he received from Governor-General Dame Cindy Kiro. It thanks him for "your letter of today notifying me of your resignation".
"It is with regret that I accept your resignation and I thank you for your service to New Zealand. I look forward to meeting during your term in Ireland," Dame Cindy wrote.
He also posted an image of him holding a baby in the Speaker's chair.
"Last time in the chair," Mallard said.
Leader of the House Chris Hipkins said an election for a new Speaker will take place on Wednesday afternoon, with deputy speaker Adrian Rurawhe nominated.
Following Mallard's announcement, Foreign Affairs Minister Nanaia Mahuta announced he had been appointed New Zealand's next Ambassador to Ireland.
"As New Zealand’s second resident Ambassador to Ireland since the opening of our Embassy in Dublin in 2018, I am delighted that the strong relationship between our countries will continue to be in excellent hands with the appointment of Mr Mallard," said Mahuta.
Mallard became the Speaker in 2017 and has been a MP for 35 years. He has held 13 ministerial roles, including Education, and will take up the Ambassador to Ireland role in January 2023.
Prime Minister Jacinda Ardern first announced Mallard's intention to retire while making a Cabinet reshuffle back in June.
"After the 2020 election Trevor told me he wanted to transition out of the role of Speaker over the course of this term to allow someone else the opportunity and to take on new challenges himself," Ardern said.
"He has worked closely with Adrian for that purpose. He will leave the chair in mid-August and take up a post in Europe from early 2023. Trevor will be the third of our five most recent Speakers to represent New Zealand abroad in a diplomatic posting."
Mallard has come under pressure, particularly from National, while in the Speaker role. Decisions he made during and after the parliamentary protest earlier this year - including to turn on sprinklers and play loud music - were criticised. He also faced scrutiny for comments he made about a parliamentary staffer.
A 1News poll in June found just 17 percent of people approved of Mallard's handling of his job as Speaker, almost half disapproved, and the rest didn't know.