It was honours just about even after 11 wickets fell on day two of the first Test between South Africa and India at the Wanderers, with Vernon Philander playing a key role for the hosts.
Having claimed three wickets in the morning session to help dismiss India for 280, the seamer came in at number eight to help steady the ship with South Africa 146-6. His 48 not out guided his side to 213-6 at stumps.
The day started with India 255-5 and looking to build a solid first-innings total as MS Dhoni and Ajinkya Rahane resumed on 17 and 43, respectively.
However, after a nervy opening the pressure finally told as Morne Morkel had the Indian skipper caught behind by AB de Villiers having added just two to his overnight score.
Things went from bad to worse for the tourists as Philander found Rahane's edge in his next over before trapping Zaheer Khan lbw to make it two wickets in two balls.
Sharma survived the hat-trick delivery but was gone just a couple of overs later, bowled by Philander, before Morkel cleaned up Mohammed Shami to leave India 280 all out. Philander ended with figures of 4-61.
South Africa's openers survived through to reach lunch on 22-0 before the batsmen dominated the afternoon session, Alviro Peterson the only casualty as he fell to Ishant Sharma for 21.
Graeme Smith and Hashim Amla steadily accumulated runs and were 118-1 at tea, Smith passing 50 in the process.
There seemed little to worry about for the home side in front of a sparse crowd in Johannesburg as South Africa reached 130-1 before a sudden flurry of wickets left them wobbling on 146-6.
Ishant Sharma got one to come back in Amla, whose decision to should arms was made to look foolish as the ball clattered into his off-stump, halfway up.
The same bowler then had Jacques Kallis plumb in front with the next ball, but wasted the hat-trick delivery seeing it sail tamely wide of De Villiers' stumps.
In the next over Smith was gone as left-arm seamer Zaheer got in on the act, hitting the Proteas captain on the pads. Smith could have no complaints as the umpire raised his finger to India's lbw appeal and it was the 13th time he has been dismissed by Zaheer in international cricket.
After three wickets without a run being scored there was a brief respite before Shami had JP Duminy caught at first slip by Murali Vijay and when he then removed De Villiers lbw, trying to work the ball to leg.
The situation looked desperate for South Africa but some solid defence initially from Faf du Plessis and Philander stemmed the bleeding before the latter started playing his shots to take South Africa beyond 200.
There was a late scare for Du Plessis who, having been hit on the glove by Ishant Sharma earlier in his innings, was tentative and edged a useful delivery from Shami towards second slip, only to see Rohit Sharma spill the catch moving to his left.
The pair survived to the close and South Africa will resume on day three 67 runs behind India with four wickets remaining.