Misbah-ul-Haq completed a second successive century to keep alive Pakistan's hopes of saving the third and final Test against India on Tuesday.
The middle-order batsman followed his second-Test 161 with a superb 133 not out to help his team post 537 in their first innings at tea on the penultimate day in reply to India's 626.
India's 19-year-old seamer Ishant Sharma, playing only his second Test, claimed the last four wickets in the afternoon session to finish with 5-118, but Pakistan had already saved a follow-on at that stage.
Misbah, 33, played a key role in two useful stands to thwart India, adding 144 for the sixth wicket with wicket-keeper Kamran Akmal (65) and 93 for the next with Yasir Arafat (44).
Needing 427 to avert the follow-on, Pakistan achieved their target in the second hour of the morning during the Misbah-Akmal partnership on an easy-paced pitch after resuming at 369-5.
There was no stopping Misbah, who continued to frustrate the Indian attack with a solid defence and a correct shot-selection. He hit 17 fours in his 322-ball knock.
It was the second successive time Misbah and Akmal helped their team avoid the follow-on, having already done so it in the drawn second Test at Kolkata with impressive centuries.
India also earned a dubious distinction of conceding a record 76 extras in a Test innings, surpassing the previous highest of 71 by the West Indies against Pakistan at Georgetown in 1988.
The sundries were the third-highest contributor in the innings after Misbah and stand-in captain Younis Khan (80).
With the pitch offering little assistance to seamers and spinners, India continued to find wickets hard to come by as they got just one in the morning.
Off-spinner Harbhajan Singh was the lone wicket-taker in the morning, when he had Akmal stumped by Dinesh Karthik.
Akmal, who was on 32 overnight, was more aggressive than his partner and executed some handsome shots during his eighth half-century in 38 Tests. He hit 12 fours in his 114-ball knock.
India had to wait for their second success as Arafat gave valuable support to Misbah before being bowled by Sharma, hitting seven fours in his 70-ball knock.
Sharma then made short work of the Pakistan tail, grabbing three wickets in successive overs. His last four wickets came off 6.1 overs for nine runs.
India lead 1-0 in the series following their six-wicket victory in the opening Test in New Delhi.