|Gambhir played a steady innings after India were set an improbable winning target of 340 at Newlands [AFP]
India emphasised their ranking as the number one team in Test cricket when they drew the third and final match and earned a share of the series against second-ranked South Africa in Cape Town.
Opening batsman Gautam Gambhir guided India to safety with a cautious innings of 64.
Set to make an improbable 340 to win, India were 166 for three when the captains agreed to call off play with eight overs remaining at Newlands.
It was the first time in five tours of South Africa that India managed a share of the honours, an achievement which seemed unlikely when they were beaten by an innings and 25 runs in the first Test in Centurion.
But India bounced back by winning the second Test in Durban by 87 runs.
A draw was a fair result after a match of fluctuating fortunes and some high-quality performances by players of both teams.
Man of the match and man of the series Jacques Kallis took his career total of Test centuries to 40 with innings of 161 and 109 not out, while Sachin Tendulkar, the only man ahead of him on the all-time list, made a battling 146 for India.
Dale Steyn, the world's leading fast bowler, took five for 75 in the first innings but had to wait until an hour and a half before the scheduled close on Thursday to add to his tally, having Gambhir caught down the leg side by wicketkeeper Mark Boucher.
South Africa first innings 362
India first innings 364
South Africa second innings 341
India second innings
G Gambhir c Boucher b Steyn 64
V Sehwag c Smith b Morkel 11
R Dravid c Prince b Tsotsobe 31
S Tendulkar not out 14
V Laxman not out 32
Total (three wickets, 82 overs) 166
FoW: 1-27 2-106 3-120
Did not bat: C Pujara, M Dhoni, Harbhajan Singh, Zaheer Khan, Ishant Sharma, S Sreesanth.
Bowling: Steyn 18-6-43-1, Morkel 15-6-26-1, Tsotsobe 13-4-29-1, Harris 30-19-29-0, Smith 4-0-27-0, Petersen 2-0-5-0
Kallis and Gambhir played crucial second innings after suffering injuries during the first innings which will keep them out of a forthcoming one-day series.
Gambhir suffered a left elbow injury while making 93 in the first innings and looked in distress when he was struck by Morkel just below the injured elbow in the second over of the second innings.
He received treatment on the field before carrying on batting with no further obvious signs of discomfort.
The left-handed Gambhir batted for 271 minutes and faced 154 balls as he made virtually certain India could not be beaten.
South Africa could make only one breakthrough in each of the three sessions.
Although there was some uneven bounce, the pitch did not help the bowlers as much as the South Africans had hoped.
Following a 2-1 defeat against Australia in 2008/09 and a drawn series against England last season, it was the third successive home series that South Africa failed to win.
Even the normally aggressive Virender Sehwag made no attempt to score quickly when India started the final innings of the series.
The first of his two boundaries came only in the seventh over, when he square-cut Steyn to the boundary, and the second was a half-chance to a leaping JP Duminy at backward point when he played a similar shot against Lonwabo Tsotsobe.
Sehwag completed a disappointing series when he was caught at first slip by South African captain Graeme Smith off Morkel for 11 after batting for three minutes short of an hour.
Sehwag scored 144 runs in the series at an average of 24.
Gambhir and Rahul Dravid defied the South African bowlers until after the afternoon drinks break in a second-wicket stand of 79 before Dravid was caught at third slip for 31 when he got a ball from Tsotsobe which kicked from just short of a length.