(CNN) -- South Africa fought back after Sachin Tendulkar's 99th international century to claim an unlikely three-wicket win over World Cup co-hosts India Saturday.
India looked set to run up a massive score in Nagpur but after Tendulkar went for 111 they lost their last nine wickets for just 29 to be bowled out for 296.
Paceman Dale Steyn did the damage with a brilliant five-wicket burst but it was still a tough total to chase on a slow pitch.
Jacques Kallis, Hashim Amla and AB de Villiers all scored half centuries to keep them in the hunt before Faf du Plessis and JP Duminy plundered late runs.
But 13 were still needed off the final over by seamer Ashish Nehra with Robin Peterson on strike and du Plessis at the other end.
Only four balls were needed as Peterson hit a four, a massive six and then two runs to pull the scores level.
A boundary through the covers clinched victory and left the Indians, who still top Group B, crestfallen.
Earlier, Tendulkar and Virender Sehwag put on 142 in just 17.4 overs in an explosive opening stand.
Gautam Gambhir (69) joined Tendulkar in another century partnership and a score well in excess of 300 looked on the cards.
But Steyn, who was named man-of-the-match for his inspired spell, turned the game his side's way after their disappointing defeat to England in their previous match.
Tendulkar has scored 48 one-day international tons to add to his record 51 Test match centuries.
Meanwhile, England off-spinner Graeme Swann has been fined 10 per cent of his match fee for his conduct in his side's shock World Cup defeat to Bangladesh Friday.
Swann was openly furious that the night-time dew at the Zahur Ahmed Chowdhury stadium made it difficult for him to grip the ball.