Pakistan finished day three with a flurry of wickets to put a different complexion on their day/night second Test with Sri Lanka in Dubai.
Chasing Sri Lanka's daunting first-innings total of 482, Pakistan were bowled out for 262, but then made their opponents pay for not enforcing the follow-on, Wahab Riaz taking three for 10 to help reduce the tourists to 34 for five.
Sri Lanka, chasing a 2-0 series victory, still led by 254, but their position was far less comfortable than it had looked only a couple of hours earlier at the Dubai International Cricket Stadium.
Mohammad Abbas had Kaushal Silva caught behind for three before Riaz made his mark, bowling Dimuth Karunaratne for seven and then giving wicketkeeper Sarfraz Ahmed another catch to get rid of Sadeera Samarawickrama for 13.
Yasir Shah trapped Suranga Lakmal lbw for one before, in the very next over, Riaz sent captain Dinesh Chandimal packing for a duck.
It took the wicket tally for the day to 15 after Pakistan earlier lost wickets at regular intervals to slump from their overnight 51 without loss to all out midway through the evening session.
Only Azhar Ali (59) and Haris Sohail (56) managed to offer sustained resistance as Sri Lanka's spin duo of Rangana Herath and Dilruwan Perera claimed three wickets apiece.
Seamers Lakmal (two for 41) and Lahiru Gamage (two for 38) shared the remaining wickets between them.