At tea, England were 205 for seven in reply to India's first innings 457, a deficit of 252 runs.
Joe Root was 13 not out and Stuart Broad one not out.
England had got through the morning session without losing a wicket.
But all that changed after lunch as Sharma, the only member of India's attack to have previously played a Test in England, took three for 29 in seven overs to transform a total of 131 for one into 172 for four.
Significantly, the tall paceman gained a measure of reverse swing that had largely eluded England's seamers as he made light of a still docile pitch. Both Australia-born opener Sam Robson and Zimbabwe-born left-hander Gary Ballance were 59 not out at lunch.
Robson, though, hadn't added to his interval score when he was lbw to Sharma.
Replays suggested the possibility of a faint inside edge but Australian umpire Bruce Oxenford's decision, given the ball hit Robson's back pad, could not be faulted at first glance.
And with the Decision Review System not being used this series because of Indian objections, it was the end of a second-wicket stand worth 125.
Ian Bell got off the mark by pulling the very next ball for four.
However, Sharma was back in the wickets with a fine delivery that straightened to have Ballance lbw for 71 and this time there was no questioning the dismissal.
Bell, in his 101st Test, looked in superb touch making a 25 that featured 24 runs in boundaries.
But with England looking for a big score from the experienced right-hander, Bell withdrew his bat too late from an attempted cut shot off Sharma and feathered a catch behind to India captain and wicketkeeper Mahendra Singh Dhoni.
Mohammed Shami had already had a memorable match, the No 11 making a Test-best 51 not out in an Indian record last-wicket stand against England of 111 with Bhuvneshwar Kumar (58).
Thurdsay also saw him bowl England captain Alastair Cook out for just five to make it 25 innings without a Test hundred for the struggling left-handed opener.
He had been largely innocuous until he produced a lifting delivery which Moeen Ali, carelessly turning his head away from the ball, gloved to Shikhar Dhawan in the slips.
Kumar then followed up his own batting exploits with two wickets for no runs in three balls.
Matt Prior (five) was given out caught behind by opposing keeper Dhoni, a reward for his decision to stand up to the stumps.
Replays suggested the noise that prompted Dhoni's appeal and Sri Lanka umpire Kumar Dharmasena's raised finger had come from the bat hitting the pad but, with no DRS, a disbelieving Prior had to go.
But there was no controversy regarding Ben Stokes's exit for a duck when the recalled all-rounder, pushing away from his body, was also caught behind.