England fought back strongly to leave the third Test against Pakistan hanging in the balance after an enthralling third day in Birmingham on Friday.
The hosts bowled out Pakistan for 400 before Alastair Cook and Alex Hales took them to 120 for no wicket in their second innings at the close, 17 runs ahead with two days remaining at Edgbaston.
Pakistan moved on to 336 for five at lunch and looked set to establish a commanding first-innings lead but England picked up their last five wickets quickly to get a foothold in the match.
Cook and Hales batted positively, the former ending on 64 not out and Hales taking a single off the final ball of the day to reach his first fifty of the series which is level at 1-1.
After resuming on 257 for three, Pakistan lost the key wicket of Younus Khan in the morning session but captain Misbah-ul-Haq led from the front with a combative 56.
Misbah was bowled by James Anderson before England's leading strike bowler was ordered out of the attack for the rest of the innings after transgressing cricket's follow-through laws for a third time.
Anderson had apologised to the umpires on Thursday for his reaction to receiving his first two warnings for running on the pitch.
Stuart Broad and Chris Woakes claimed three wickets each to run through Pakistan's lower order.