India 280 (Kohli 119, Philander 4-61) and 421 (Pujara 153, Kohli 96) drew with South Africa 244 (Smith 68, Philander 59, Ishant 4-79, Zaheer 4-88) and 450 for 7 (Du Plessis 134, De Villiers 103)
Scorecard and ball-by-ball details
'Dhoni was ahead of Smith in this match'
'Dhoni was ahead of Smith'
First they pulled off 438, the highest successful chase in ODIs. Today, faced with a target of 458 on a tricky Wanderers pitch, South Africa came within eight runs of breaking the world record for a chase in Test cricket.
At the start of the fifth day, South Africa needed 320 with eight wickets in hand, and a draw was their more realistic goal. But after losing two wickets early on, Faf du Plessis and AB de Villiers, the protagonists of the Adelaide escape, began a partnership that swelled to 205 and turned the game. They took South Africa to within 56 runs of victory. By the time both were dismissed, South Africa needed 16 runs, but with only Imran Tahir and the injured Morne Morkel to come, Vernon Philander and Dale Steyn batted out 19 deliveries to secure one of the game's greatest draws.
The two quicks were the last men standing after what will be remembered as one of the most exciting last hours of Test cricket. It began with de Villiers and du Plessis at the crease, both having scored a hundred and South Africa needing 66 off 15 overs to win. But then India surged back into contention by removing both and JP Duminy in the next 12 overs, before it all ended with Philander and Steyn choosing safety first despite how close South Africa were.
Du Plessis and de Villiers batted together for a minute short of four hours and faced 375 balls to take South Africa from 197 for 4 - when they still needed 261 runs to win - to being in sight of victory. They showed immense patience and composure on a pitch with variable bounce and sizeable cracks, wore down an Indian attack that tried everything and rode the luck that came their way.
When the drinks came out in the final session, MS Dhoni rallied his men in a huddle, South Africa were in relative control, the light was good and chase was on. For two overs, du Plessis and de Villiers kept them on track. Against the run of play, de Villiers chopped one on from a back of a length Ishant Sharma delivery. India had the opening they wanted but plenty still to do.
JP Duminy, who scored a half-century in South Africa's chase of 414 in Perth, was next in. He took a single to keep strike at the end of the over, drilled a straight drive for four off the first ball of the next but three deliveries after that, he also played on. Duminy was attempting an expansive cover drive but inside-edged to turn the advantage India's way.
Vernon Philander and du Plessis kept South Africa in it with a partnership of 35 off 49 balls. Their stand was filled with tension as Mohammed Shami and Ishant continued to test them with deliveries that jagged back in or rose from a length. When they offered anything short and wide, the result was a boundary.
With four overs left, the pendulum had swung South Africa's way. Poetically, the score was 438 and they needed 20 more runs. They got four of those when du Plessis flayed Zaheer through midwicket. Two balls later, du Plessis called for a run after hitting straight to mid-off. Ajinkya Rahane's direct hit found du Plessis, exhausted after the amount of time he had spent at the crease, well short of his ground.
Dale Steyn joined Philander, Morkel and Imran Tahir were padded up but the shop had shut. Shami bowled an over of short balls to Steyn, which he made no contact with to leave South Africa needing 16 off the last two overs.
Philander blocked out the penultimate over and Steyn left the first two balls of the last over, to leave South Africa needing boundaries off the last four balls. Steyn slogged the third ball but missed and took a bye, Phulander heaved at the next and missed before getting a single and then Steyn smashed the final delivery into the stands over long-on but it meant nothing.
Although intense, it was also an anti-climax after South Africa set themselves up for a historic win when in the morning, only a draw would have been on their minds When du Plessis and de Villeirs came together they locked in on an Adelaide-esque approach of spending as much time as possible at the crease, without worrying about the scoreboard.
Their first 50 runs were scored mostly while on the defensive. They took 115 balls and 40% of the runs came in singles to usher South Africa past lunch and towards the second new ball. Seventeen minutes into the second session, the new nut became available and MS Dhoni was ready to play his next hand.
Zaheer and Shami went searching for wickets and found movement but not success. Du Plessis was the first to bring up his 50, off 142 balls, when he pulled Shami through deep square leg. AB de Villiers followed suit, with the same shot of the same bowler but not before Ishant had induced the edge from both batsmen. The pitch played its part as well, as balls landing on the cracks reared off a length to put the batsmen in considerable discomfort, often looping over the slip cordon. Both de Villiers and du Plessis had to counter balls striking the shoulders of their bats, pushed those alarming moments in the backs of their minds and steadily pushed South Africa forward.
With that good fortune and plenty of fortitude, the partnership's second 50 was scored in just 85 balls and the batsmen's belief had grown.
They were not intimidated by Dhoni's plan to suffocate them with close catchers surrounding the bat and the slower bowlers in operation. Du Plessis and de Villiers squeezed the singles, found boundaries when the seamers occasionally veered off their probing wicket to wicket lines. By tea, they had reached 331 for 4 and still needed 127 runs to win.
Dhoni had what seemed his last throw of the dice, when Zaheer bowled a spell after tea, even though Shami was the man who posed the biggest threat earlier today. Shami returned an hour later and things started to happen for India's bowlers, who were was consistent, disciplined and tireless even though they, like South Africa, did not get the desired result.
'SA should've pushed for win'
'South Africa should've pushed for win' - Cullinan

Firdose Moonda is ESPNcricinfo's South Africa correspondent