Alistair Cook fell six runs short of his 20th Test ton as late wickets from Saeed Ajmal breathed life into the second Test between England and Pakistan.
England looked to be cruising at 166-1 in reply to Pakistan's first innings of 257 at the Sheikh Zayed Stadium in Abu Dhabi, but Pakistan fought back hard late on day two to leave the tourists 207-5 at stumps.
Pakistan resumed on day two at 256-7 and with captain Misbah-ul-Haq unbeaten on 83, the captain was eyeing off a century.
But disaster struck early as Misbah added just one to his score before Stuart Broad (4-47) trapped him LBW.
The skipper reviewed the decision but was unsuccessful, and in the next over Jimmy Anderson (2-46) ripped through what remained of the Pakistan batting order as Ajmal and Junaid Khan were both dismissed without scoring a run.
That momentum gave England the upper hand and although they lost their captain, Andrew Strauss, for just 11 off the bowling of Mohammad Hafeez (1-40), they quickly regrouped.
Cook was joined by Jonathan Trott (74) and the pair quickly got to work, showing enormous application and patience to add 139 runs in a partnership that lasted more than 50 overs.
Trott's 158-ball knock was eventually ended by Abdur Rehman (1-39) and 11 overs later, Cook followed suit.
He hit 10 fours in his 94, off 220 balls, but was undone by the wily spin of Ajmal (3-67) and given out LBW.
Ajmal also removed Kevin Pietersen (14) and Eoin Morgan (3) in the last hour, with the latter falling on the last ball of the day.
Ajmal's clever spin was crucial on a pitch that is not offering much for the quicks.
Pacemen Umar Gul (0-35 from 10 overs) and Junaid Khan (0-20 off six) were not used much, with spinners Ajmal, Hafeez and Rehman bowling more than 68 overs between them on day two.
Ian Bell will resume on four not out and will be joined at the crease by wicketkeeper Matthew Prior.