South Africa players celebrate their historic victory
New Zealand (15) 28
Pens: Carter (6)
Drop Goal: Carter
South Africa (17) 30
Try: Pietersen, Januarie
Pens: Montgomery (3), James (2)
Ricky Januarie's late try secured South Africa's first win in New Zealand for 10 years as they ended the Kiwis' world record 30-match unbeaten home run.
Dan Carter's 23 points looked to have won it for New Zealand before Januarie pounced with just six minutes left.
JP Pietersen's try and a Butch James drop-goal gave South Africa a narrow 17-15 lead at the break.
Sione Lauaki's try and Carter's kicks put the All Blacks ahead until Januarie sealed the win and Tri-Nations points.
After a bad-tempered build-up to the match, centring on comments from former All Blacks prop Craig Dowd about Springboks coach Peter de Villiers, the first half hour was something of an anti-climax.
Neither tryline came under much threat in a forgettable and penalty-strewn start to the match.
The home side outscored the Springboks by four Carter penalties to Percy Montgomery's three, but arguably the most significant moment of the first period came early on, when New Zealand lock Ali Williams clashed heads with Schalk Burger.
Williams soldiered on until the half-hour mark before going off to be replaced by youngster Kevin O'Neill, and New Zealand soon paid the price.
They were in total disarray at the next line-out, and from the resulting scrum Pietersen went over in the corner to mark his birthday with a try.
James's opportunistic drop-goal added to South Africa's lead before Carter's fifth penalty pegged them back just before the break.
New Zealand were far more lively after the restart, with Rudi Wulf being unlucky on two occasions not to get on the end of well-placed kicks from Carter which could have set up scoring chances.
And Lauaki scored a deserved try when he finished off a sustained period of pressure which was kept alive when Conrad Smith burrowed through several challenges to off-load.
James put over two penalties to keep the pressure on, but Carter's quick turn to fire over a drop-goal ensured New Zealand retained a narrow advantage.
The referee had already given both sides final warnings about high tackles before Victor Matfield took Lauaki round the neck with seven minutes left.
Matfield's yellow card left South Africa up against it
His yellow card meant South Africa would have to play out the game a man short, but no sooner was the challenge thrown down than Januarie accepted it in dazzling fashion, breaking through the defence and collecting his own chip ahead to score.
Replacement Francois Steyn held his nerve to kick the conversion and edge South Africa ahead on the scoreboard with time running out.
New Zealand pinned all their hopes on a late Carter drop-goal attempt but his two attempts were unsuccessful, with the first narrowly missing the target and the second being charged down.
Steyn collected the loose ball and drove upfield before, fittingly, Januarie booted the ball off the pitch to spark South Africa's celebrations after their first ever win at Dunedin's Carisbrook ground.
"It took us 100 years to win here and hopefully we won't have to wait another 100 years to win again," said Springboks centre Jean de Villiers.
"We're ecstatic. We worked hard all week on the things we did wrong in Wellington, we put those things right and obviously we got the result."
New Zealand: Mils Muliaina, Sitiveni Sivivatu, Conrad Smith, Ma'a Nonu, Rudi Wulf, Dan Carter, Andy Ellis; Tony Woodcock, Andrew Hore, John Afoa, Anthony Boric, Ali Williams, Adam Thomson, Rodney So'oialo (capt), Jerome Kaino.
Replacements: Keven Mealamu, Neemia Tialata, Kevin O'Neill, Sione Lauaki, Jimmy Cowan, Stephen Donald, Leon MacDonald
South Africa: Percy Montgomery, JP Pietersen, Adrian Jacobs, Jean de Villiers, Bryan Habana; Butch James, Ricky Januarie; Gurthro Steenkamp, Bismarck du Plessis, CJ van der Linde, Bakkies Botha, Victor Matfield (captain), Schalk Burger, Juan Smith, Joe van Niekerk.
Replacements: Schalk Britz, Brian Mujati, Andries Bekker, Luke Watson, Ruan Pienaar, Francois Steyn, Conrad Jantjes.
Referee: Matt Goddard (Aus)