Blackcaps bowler Neil Wagner has played his final test for New Zealand.
The 37-year-old has called time on his 64-test career and will bow out before the upcoming two-test series against Australia.
NZ Cricket has confirmed he won't feature in the starting XI for the first test starting in Wellington on Thursday and will be released from the squad before the second test in Christchurch.
Renowned for his workhorse approach to bowling and passionate celebrations, Wagner finishes with 260 wickets at average of 27 runs - placing him fith on the list of New Zealand's top wicket-takers after 12 years in and around the starting XI.
His strike rate of 52 only bettered by the great Sir Richard Hadlee for NZ bowlers who have surpassed 100 wickets.
Wagner admits he's had an "emotional" week pondering his decision, but is confident the timing is right for him to step aside and make way for the next generation to stake their claim.
"It's not easy to step away from something you've given so much to and got so much out of, but it's now time for others to step up and take this team forward," Wagner said.
"I've enjoyed every single moment of playing test cricket for the Blackcaps and am proud of everything we've been able to achieve as a team.
"The friendships and bonds built over my career are what I'll cherish the most and I want to thank everyone who's played a part in where I am today.
"My teammates have always meant the world to me and all I've ever wanted to do was what was best for the team - I hope that's the legacy I will leave."
Among the highlights Wagner identified were helping the Blackcaps to their World Test Championship triumph in Southampton in 2021 and his efforts with the bat helping the team salvage a draw to clinch a test series win against England in 2018.
Of his 64 test appearances, Wagner won 32, claiming 143 wickets at an average of 22 in those victories.
Blackcaps coach Gary Stead said Wagner's impact on the team went beyond the statistics, with his competitive drive one of the many intangibles that made him such an instrumental part of the squad for over a decade.
"Neil's numbers are phenomenal, but I don't think we can underestimate his contributions to the team when the chips were down and he found a way to create a wicket," said Stead.
"His accuracy, execution and tenacity has been instrumental in many of our great Test victories and he will always be remembered for his lion-hearted nature.
"Neil gave absolutely everything to the Blackcaps and we are certainly going to miss his energy and 'never give in' attitude."
Wagner's trademark grit and determination were best exemplified during a 2016 test against Australia, when he soldiered through a broken knuckle to set then career-best figures of 6/106.
That year, he finished as New Zealand's leading test bowler - taking 32 wickets through seven matches at an average of 21.
Wagner couldn't fight back the tears as he reeled off a list of thank yous, making special mention of the sacrifice made by his wife Lana, his daughters, Olivia and Zhali, and son Josh.
Former Blackcaps captain and teammate Brendon McCullum was also singled out, with Wagner referring to one notable remark the now England test coach passed on to him as he mulled over his decision to retire.
"He always spoke about leaving the Black cap in a better place than what you found it and moving that legacy forward," he recalled.
"I thought that was something I could be pretty proud of and being part of a group that's constantly growing is something that has stuck with me.
"It's been amazing to see guys like Kyle Jamieson and Will O'Rourke able to come in and fit seemlessly into the group.
"I feel like it's the right time to takeover to make it their team and to be able to do the same thing.
"Hopefully I've set the bar for them to be able to do that."
Wagner's test debut was in Antigua against the West Indies back in 2012, part of a bowling attack that also included the likes of Chris Martin and Dan Vettori.
He batted in the middle order during that match - coming in at No. 5 in both innings as nightwatchman with scores of four and 13. With the ball, he recorded overall figures of 1/147 off 38 overs. New Zealand lost the match by nine wickets.
His career best came during New Zealand's second-test win over Bangladesh back in 2019, when his haul of 9/73 lifted him to fifth in the world test bowler rankings.
Injuries have limited his impact in recent times, with the years of digging in with patented short balls beginning to take a toll on his body, particularly his back.
Last but certainly not least, Wagner signed off with a heartfelt tribute to the NZ fans and his teammates.
"I can't thank you enough for the support," he said, choking back tears.
"For making me feel welcome. For making me feel like a Kiwi, and for all, the chants over the years, lifting me up when the body was sore.
"To my teammates, they're the bunch that create those memories in the changing room.
"They're the ones who motivate you, they're the ones who played a part in helping me become the player, person, the father and the husband that I am."
Wagner will continue to play for Northern Districts at domestic level this season and plans on carrying through to next year, either in New Zealand or overseas.
NZC says Wagner will be recognised during this week's first test against Australia at the Basin Reserve and further celebrated at the annual NZC awards next month.