Mohammed Shami shined on the final day as he took a five-wicket haul to seal India's win in the first Test.
Ravichandran Ashwin triggered the South African collapse as he removed Thenuis de Bruyn, and became the joint-fastest to 350 wickets in Tests.
Mohammed Shami went on a rampage as he removed Temba Bavuma, Faf du Plessis and Quinton de Kock to end Proteas' chances of securing an improbable victory
Ravindra Jadeja, then, took three wickets in an over, as South Africa stared at a humiliating defeat.
However, Dane Piedt (56) and Senuran Muthusamy (49*) forged a 91-run partnership for the 9th wicket to lead South Africa's fightback.
However, Shami struck once again, as he dismissed Piedt, and then Rabada to ensure India's win.