England were 46-2 with Alastair Cook (17) and Joe Root (six) fighting hard against Pakistan's spinners, led by Shoaib Malik who claimed both the wickets on a weary Sharjah stadium pitch.
England will need another 238 runs on the fifth and final day on Thursday for a series-levelling win while Pakistan will fancy a 2-0 victory.
Pakistan won the second Test by 178 runs in Dubai while the first ended in a draw in Abu Dhabi.
It was Malik, due to quit Test cricket after this match, who provided Pakistan early breakthroughs, trapping Moeen Ali (22) leg-before and then bowled Ian Bell (nought) in successive overs.
Cook and Root survived confident leg-before appeals off Zulfiqar Babar in the dying moments, much to the relief of the England camp.
England's best chase in all Test cricket is 332 they did against Australia at Melboure in 1928 while they have not crossed more than 209-run target in Asia, achieved against Bangladesh at Dhaka five years ago.
England could have dismissed Pakistan for less than 355 in their second innings and subsequently chasing an easier target had they not dropped two crucial catches of Hafeez on 113 and Asad Shafiq, who made 46, on 29.
It was paceman Stuart Broad who led the attack admirably with 3-44 and was ably backed up by James Anderson (2-52) to help England take the last six Pakistan wicket with the second new ball for 126 runs.
It was only through Shafiq and Srafraz Ahmed's 55-run stand for the seventh wicket that Pakistan's lead soared over 250 plus as the pair batted with determination.
Spinner Samit Patel dismissed the Pakistan wicket-keeper for 36 before Broad had Shafiq to leave Pakistan at 354-9.
England took the second new ball after 81 overs with Pakistan at a lunch score of 229-4 and Broad struck in the fifth over, trapping Pakistan skipper Misbah-ul-Haq leg before for 38.
Misbah hit two fours and a six and became Broad's 50th wicket in the calendar year in 13th Test, the best in 2015.
Misbah and Hafeez added an invaluable 93 runs for the fifth wicket.
Hafeez, dropped by Broad off his own bowling when on 113, drove Anderson for two to complete the 150-mark, his 4th 150 plus in all Tests but a run later holed out to spinner Ali at long-on where Bell took a simple catch.
Hafeez batted for 380 minutes, faced 266 balls and hit 15 boundaries and three sixes.
With Hafeez's catch Bell became the eighth English fielder to take 100 plus catches in Test cricket. This is his 118th match.
It was a battle of survival for Pakistan in the morning session as England looked for early wickets.
Hafeez survived some anxious moments as leg-spinner Adil Rashid trapped him in front of the wicket with the first ball of the day, after Pakistan resumed on 146-3.
England challenged New Zealand umpire Chris Gaffaney's not out decision but television umpire Paul Reiffel of Australia upheld the verdict.
One ball later Hafeez charged down the wicket against a googly from Rashid but missed the ball completely. However wicketkeeper Jonny Bairstow missed a stumping chance and the ball went for four byes.
Hafeez swept Rashid in the next over for a single to reach his century off 169 balls, his second at the Sharjah stadium.
England players wore black armbands in memory of former batsman David Graveny who died on Tuesday after long illness. He played 79 Tests for England.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ