Winger Aphiwe Dyantyi scored two tries as the Springboks upset the form book to record a 36-34 victory over New Zealand in their Rugby Championship clash in Wellington.
It was the first loss by the All Blacks to the Springboks in New Zealand since 2009 and kept the southern hemisphere championship alive until at least the fifth round of games in two weeks' time.
Willie Le Roux, Malcolm Marx and Cheslin Kolbe also crossed for the visitors, who had lost their previous two matches and been under immense pressure heading into the game.
Rieko Ioane scored twice for the All Blacks, while Jordie Barrett, Aaron Smith, Codie Taylor and Ardie Savea also crossed for the home side, while Beauden Barrett had a poor game with the boot, slotting just two of his six shots at goal.
"All we wanted to do today was just give our best, give 100 percent for each other and make sure the guy next to you respects you after the whistle," Springboks captain Siya Kolisi said after the South Africans held out the world champions with 14 men for the last 10 minutes.
"I have no words, I can't say much. Our main thing is effort in our team, we've let ourselves down in the last couple of games. I think we showed a little bit of what we can do tonight.
"We should be proud of ourselves but plenty more work to do."
Few had given the Springboks any chance of winning Saturday's game, having lost their last two matches and seemingly dropped below the standard that drove them to a 2-1 series win over England in June.
Mindful the All Blacks have scored 38 or more in each of their Rugby Championship games this season, they knew they would need to score more than 30 themselves to have a chance.
The Springboks started poorly, going 12-0 down inside the first 20 minutes as Jordie Barrett and Smith were put over as the All Blacks showcased their superb ability to offload under pressure.
The problem with wanting to do everything at speed, however, resulted in poor decision making with the Springboks pouncing on errors deep inside All Blacks territory to score three unanswered tries within 11 minutes to earn a 21-12 lead.
From then on, the All Blacks were chasing the game and while they struck back with Ioane's first try, the Springboks went into halftime with a 24-17 lead following Handre Pollard's only penalty.
Replacement winger Kolbe intercepted a pass from Anton Lienert-Brown to give the Springboks a 14-point lead two minutes into the second half, which proved to be the advantage they needed as the All Blacks came storming back.
Taylor and Savea crossed from lineout drives to set up a nail-biting finish that ended when Damian McKenzie lost the ball in a tackle.
"You've got to give them all the credit in the world the way they defended in that second half," All Blacks captain Kieran Read said.
"We threw everything at them, my boys kept working hard but the South Africans defended outstandingly well and obviously deserved their win.
"They put us under pressure and we didn't respond the way we needed."