South Africa needed a late penalty to clinch a 27-25 win over New Zealand in the Rugby Championship after the All Blacks overturned an eight-point deficit in the second half.
Francois Hougaard put the Springboks ahead early on with a lengthy run for the try line for his first international score against the All Blacks.
South Africa continued to look the stronger of the two sides as half time approached, with Handre Pollard crashing over twice before the end of the first 40 minutes.
However, Malakai Fekitoa kept the world champions in contention by scoring New Zealand's first try of the game following a quick break from Julian Savea.
Ben Smith and Dane Coles led the New Zealand fight back after the break, scoring two tries in four minutes to put the visitors one point ahead with 10 minutes to play.
However, Pat Lambie made a 55-metre penalty in the final moments of the match following a shoulder charge on Schalk Burger, sealing the win for the hosts.
Despite losing their 22-match unbeaten run, New Zealand had already secured the Rugby Championship title.