On a day when the Indian pacers failed to make much of a dent on an easy-paced wicket, Aswhin (3/90) emerged as the most successful bowler as he dismissed Markram (94), Dean Elgar (31) and Quinton de Kock (0).
The hosts were going strong with Amla (82) anchoring the Proteas innings after Markram, playing on his home ground, missed out on a well-deserved century by a whisker.
However, two run-outs and a wicket by Ashwin within 13 balls saw South Africa slump from 246/3 to 251/6 as India sought to wrest control of the match while somewhat masking a couple of questionable selections in the playing XI.
Post tea, Amla and AB de Villiers (20) took their third- wicket partnership to 51 runs. South Africa crossed 200 in the 64th over, but not before losing de Villiers as he played on off Ishant Sharma (1-32), who got just reward for his toiling spells.
Amla then put on 47 runs with du Plessis, and in doing so, scored his 36th Test half-century off 99 balls. It looked to be a dominant day for the hosts before a mini-collapse came by.
First, in the 81st over, Amla was run-out against the run of play, getting mixed up with du Plessis as he set off for a single but Hardik Pandya (0-37) found the target on the non- striker's end off his bowling.
Two balls later, Ashwin dismissed Quinton de Kock for a golden duck, caught at slip. Vernon Philander (0) was then run-out on the last ball of the 83rd over as he set off for a run even as du Plessis called no from the non-striker's end.
The shot from Elgar hit Murali Vijay in the mid-riff and lodged there, with the fielder acting quickly enough to catch it.
India then attacked Amla with short stuff as also attempting to lure him outside the off-stump. Jasprit Bumrah (0-57) was unimpressive in this spell, unable to find the right line to attack the batsmen.
Markram's wicket came against the run of play. He asked for DRS review and was a tad unlucky as the edge was doubtful. But there wasn't sufficient evidence to overturn the on-field umpire's decision.
South Africa had crossed 100 in the 36th over, and their 150 came up in the 47th. Amla, batting on 30 then, was lucky to survive as Parthiv Patel dropped him off Ishant in the 51st over, the ball going down leg side after the batsman edged it.
Elgar and Markram had started watchfully against the new-ball pairing of Bumrah and Shami, the latter conceding 23 runs off his four overs.
The new ball bowlers failed to create any chances, and Ishant came on as first-change in the 8th over. He immediately troubled Elgar and continued to do so throughout his first spell.
Pandya came on to bowl in the 13th over. By the 20th over, when Ashwin was introduced into the attack, India had used up all their frontline bowlers in just over an hour's play.
Ashwin too probed Elgar, and in the 24th over, had a caught-behind appeal turned down. India opted for DRS review but there was no edge.
The Proteas had crossed 50 in the 21st over. Meanwhile, Markram reached his second Test half-century off 81 balls, just before the break.
Wriddhiman Saha was ruled out due to a strain and Parthiv Patel took his place in the team.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)