India was set a target of 340 runs to win its first Test series in South Africa after Jacques Kallis scored his second consecutive century in Cape Town.
South Africa was 53-3 when Kallis came in to bat and ended the fourth day 341 all out. The 35-year-old, playing with a side injury, finished unbeaten on 109 with eight fours from 240 balls. It was the 40th time he scored more than 100 runs in a Test match, after reaching 161 in the first innings.
South Africa was bowled out for 362 runs in its first innings, while India, the top-ranked Test squad, responded with 364.
Harbhajan Singh took seven wickets in the innings for India, which tied the three-Test series with an 87-run win in Durban last month. South Africa won the first match at Centurion by an innings and 25 runs.