Barbarians (14) 25
Tries: Habana (3) Cons: Giteau (2) Pens: Giteau, Steyn
New Zealand (10) 18
Tries: Smith, Boric Con: Donald Pens: Donald, Delany
Highllights - Habana tries help Barbarians beat All Blacks
A hat-trick of tries by Springbok Bryan Habana inspired the Barbarians to only their second-ever win over New Zealand.
Habana notched two dazzling breakaway scores in the first half with the All Blacks replying with a Ben Smith try.
A Matt Giteau penalty made it 17-10 before lock Anthony Boric bundled over for an unconverted New Zealand score.
Giteau and Morne Steyn combined to set up Habana for his third, and Steyn's late penalty ended New Zealand's 100% record in the final game of their tour.
The first half was a scrappy but entertaining affair, and despite New Zealand's weeks of touring and playing together, it was the Barbarians who seemed to gel more quickly.
Stephen Donald had kicked a New Zealand penalty before the Baa-Baas claimed the first try in trademark cavalier fashion.
It is unbelievable. To come together last Sunday, have a couple of training sessions and then produce a performance like that
Drew Mitchell scooped up a loose ball inside his own 22 and sprinted 50 yards up the touchline before off-loading to the supporting Habana, who raced away to dive over in the left-hand corner.
This roused New Zealand into life, and Zac Guildford looked on course to level from a Brendon Leonard-inspired attack, only to be denied by a superb smother tackle by Fourie du Preez.
But it was only a temporary delay to the inevitable, and it was winger Smith who went over in the right corner after Luke McAlister's break in midfield sparked a superb move.
Leonard was again in the thick of the action when his dogged tackling denied Du Preez a second Barbarians try after Jamie Roberts' off-load allowed him to run straight and punch a hole in the defensive line.
Heading towards the end of the first half, the All Blacks had the majority of possession but failed to turn it into points, and in the dying seconds they were made to pay.
Video - Habana's breakaway try for Baa-Baas
Habana intercepted a pass near the half-way line and after several goes at juggling the ball finally got it into his hands and streaked away from the remaining cover o score.
Only a superbly-timed McAlister tackle stopped Rocky Elsom extending the Barbarians' lead just after the break, bundling the Australia captain into touch right on the corner flag.
When Giteau's penalty stretched the Barbarians advantage, New Zealand upped the pressure and finally got their reward when Boric powered over from close range after great approach work by McAllister and Rodney So'oialo.
But with 11 minutes left Giteau's dart and offload made space for Habana to go over in the left corner to seal his hat-trick.
Replacement fly-half Mike Delany kicked a penalty after 72 minutes to reduce the All Blacks' deficit to four points.
But Steyn stepped up to restore the seven-point cushion and despite New Zealand's best efforts, the Barbarians held on for a famous win, their first over the All Blacks since their celebrated 1973 victory in Cardiff.
Barbarians wing Bryan Habana: "It is right up there with my best moments. It was a fantastic side with an unbelievably talented group of players.
"To beat an All Blacks side who haven't lost on this tour is pretty special. We understand the Barbarians ethos and rugby is all about friendship. It has been an amazing week."
Barbarians centre Jamie Roberts: "It is unbelievable. To come together last Sunday, have a couple of training sessions and then produce a performance like that...it is one of the best weeks of my life. I am hugely grateful to the Blues for releasing me."
Barbarians coach Nick Mallett: "Bryan Habana is exceptional, a fantastic player to coach because you don't have to coach him. He understands defensive systems so well, it is no coincidence he scores so many intercept tries, and he has such great pace.
"Jamie Roberts was absolutely fantastic like he was for the Lions in South Africa, so was Matt Giteau. All the guys did a great job.
"Everyone remembers the 1973 match and the great try [by Gareth Edwards]. Hopefully this will also go down in history as a great performance."
New Zealand assistant coach Wayne Smith: "It is disappointing, although the Barbarians are a great team and it was a joy to play in that match.
"We gave away a couple of sloppy tries against the run of play and couldn't quite peg it back. But we wanted to give these guys another opportunity, that was an objective of the tour."
Barbarians: Drew Mitchell (Australia); Joe Rokocoko (New Zealand), Jaque Fourie (South Africa), Jamie Roberts (Wales), Bryan Habana (South Africa); Matt Giteau (Australia), Fourie du Preez (South Africa); Salvatore Perugini (Italy), Bismarck du Plessis (South Africa), W P Nel (uncapped), Carlo del Fava (Italy), Victor Matfield (South Africa, captain), Rocky Elsom (Australia), Schalk Burger (South Africa), George Smith (Australia).
Replacements: Stephen Moore (Australia), Tendai Mtawarira (South Africa), Quintin Geldenhuys (Italy), Andy Powell (Wales), Will Genia (Australia), Morne Steyn (South Africa), Leigh Halfpenny (Wales).
New Zealand: Cory Jane, Ben Smith, Tamati Ellison, Luke McAlister, Zac Guildford, Stephen Donald, Brendon Leonard; Wyatt Crockett, Corey Flynn, John Afoa, Jason Eaton, Anthony Boric, Liam Messam, Richie McCaw, Rodney So'oialo.
Replacements: Andrew Hore, Neemia Tialata, Adam Thomson, Tanerau Latimer, Jimmy Cowan, Mike Delany, Sitiveni Sivivatu.