Tokyo -Veteran winger Ben Smith scored a classy try double as New Zealand beat Wales 40-17 to clinch third spot at the Rugby World Cup on Friday in the perfect send-off for storied coach Steve Hansen.
In what was the final Test for both Hansen and Wales counterpart Warren Gatland, after seven and 12 years at their respective helms, both sides produced an entertaining encounter that saw New Zealand outscore the Welsh by six tries to two.
The result means New Zealand have won 32 of their 35 meetings with Wales, last losing in 1953, while Hansen's incredible record includes just 10 defeats in 107 Tests in charge.
"It was just important we come back and honoured the jersey and our fans and get over the disappointment of last week," said Hansen, referring to the semi-final defeat by England.
"Tough old game for both sides and just want to congratulate Wales too because I know they'll be feeling a bit at the moment."
Gatland, under whose charge Wales have won 85 of their 151 Tests - but have lost all 12 matches against his native New Zealand - might have joked that it would have been better to settle the play-off by a drinking game, but both teams showed intent on the pitch.
"Our boys never gave up and kept trying to play some good rugby in the second half. Probably a game too far for us really," said the New Zealander, who will now coach the Waikato Chiefs.
"I've loved my time in Wales. People have been amazing and incredibly welcoming. But that era's over now and I'm excited about the next challenge going back to New Zealand and being involved with the Chiefs."
Richie Mo'unga missed an early penalty, but that was merely a blip as the All Blacks looked to run the ball at every opportunity at a packed Tokyo Stadium.
The first try came quickly, the influential Aaron Smith finding skipper Kieran Read, who offloaded to Brodie Retallick, the lock stepping inside Rhys Patchell and producing a brilliant backhanded pass to Joe Moody, the prop bounding in from 20 metres for a great front rower's try.
Mo'unga converted and added a second after Beauden Barrett scampered over after a neat Aaron Smith drop-off that left Wales prop Dillon Lewis prone.
A sustained period of Welsh pressure then followed and paid off after Patchell found Hallam Amos with a long miss-pass, the full-back dummying Mo'unga and shooting over for a try.
Patchell added the conversion and then a simple penalty, but New Zealand roared back through veteran Ben Smith, the winger jinking his way through a crowded defence after good lead-up work by Read and Liam Coltman.
Smith, 33, got his double on the stroke of half-time, taking a long pass from his namesake Aaron and powerfully handing off Tomos Williams to slide into the corner.
Mo'unga added the extras to leave New Zealand in complete control at 28-10 at half-time.
The cut-and-thrust, running rugby continued in the second period, Ben Smith surging deep into Welsh territory before Sonny Bill Williams provided a perfect offload for centre partner Ryan Crotty to cross for the try.
Both sides were much different from their semi-final line-ups, Hansen having made seven changes to the team which lost 19-7 to England and Gatland nine from the side that went down 19-16 to South Africa.
One ever-present on the team list for Wales, however, has been Josh Adams, and the winger burrowed over from close range for a seventh try of the tournament to usurp Shane Williams' Welsh record of at a World Cup.
The game became increasingly error-strewn, but Mo'unga stepped through Dan Biggar's poor tackle for a late try, taking his personal tally to 15 points.
NZ 40 (26)
Tries: Joe Moody, Beauden Barrett, Ben Smith (2), Ryan Crotty, Richie Mo'unga
Conversions: Mo'unga (5)
Wales 17 (10)
Tries: Hallam Amos, Josh Adams
Conversions: Rhys Patchell, Dan Biggar
15 Hallam Amos, 14 Owen Lane, 13 Jonathan Davies, 12 Owen Watkin, 11 Josh Adams, 10 Rhys Patchell, 9 Tomos Williams, 8 Ross Moriarty, 7 James Davies, 6 Justin Tipuric, 5 Alun Wyn Jones (captain), 4 Adam Beard, 3 Dillon Lewis, 2 Ken Owens, 1 Nicky Smith
Substitutes: 16 Elliot Dee, 17 Rhys Carre, 18 Wyn Jones, 19 Jake Ball, 20 Aaron Shingler, 21 Gareth Davies, 22 Dan Biggar, 23 Hadleigh Parkes
15 Beauden Barrett, 14 Ben Smith, 13 Ryan Crotty, 12 Sonny Bill Williams, 11 Rieko Ioane, 10 Richie Mo'unga, 9 Aaron Smith, 8 Kieran Read (captain), 7 Sam Cane, 6 Shannon Frizell, 5 Scott Barrett, 4 Brodie Retallick, 3 Nepo Laulala, 2 Dane Coles, 1 Joe Moody
Substitutes: 16 Liam Coltman, 17 Atu Moli, 18 Angus Ta'avao, 19 Patrick Tuipulotu, 20 Matt Todd, 21 Brad Weber, 22 Anton Lienert-Brown, 23 Jordie Barrett