Pakistan hit back with five late wickets on a dramatic third day of the second Test after capitulating with the bat but Sri Lanka hold a healthy lead as they scent a series victory in Dubai.
Sri Lanka claimed a first-innings lead of 220 after Pakistan collapsed from 180-4 to 262 all out, spinners Rangana Herath (3-84) and Dilruwan Perera (3-72) taking three wickets apiece.
Azhar Ali (59) and Haris Sohail (56) made half-centuries, but Pakistan's innings fell to pieces before Wahab Riaz (3-10) did the bulk of the damage as Sri Lanka slumped to 34-5 at stumps on a day in which 15 wickets fell.
Despite such a woeful start to their second innings, the tourists will fancy the chances of sealing a 2-0 whitewash when they resume on day four with a lead of 254 after seeing Pakistan struggle so badly with the bat on Sunday.
Debutant Lahiru Gamage (2-38) struck in the sixth over of the day to end an opening stand of 61, getting one to nip back in and bowl Shan Masood for his first Test wicket.
Sami Aslam (39) was on his way when he was trapped leg before by Dilruwan in the next over and Pakistan were in trouble on 115-4 at tea after Asad Shafiq and Babar Azam fell cheaply.
Sohail smashed his second ball from Herath for six over long-on and hit the spinner over the ropes for a second time, while Azhar played a composed knock at the other end and both players passed 50 in a much needed stand of 71.
It was no surprise that it was the ever-reliable Herath who got the breakthrough, Azhar sent on his way after Sri Lanka reviewed when he was hit plumb in front and that sparked a collapse.
Yasir Shah (24) produced a couple of lusty blows before he was cleaned up by Suranga Lakmal (2-41) and Pakistan lost their last six wickets for 82 runs before giving themselves hope in a stunning final session.
Dimuth Karunaratne played on to a Wahab delivery, just as he did on 196 in the first innings, after Mohammad Abbas set the tone by snaring Kaushal Silva caught behind.
Sadeera Samarawickrama and nightwatchman Lakmal also departed before Wahab got skipper Dinesh Chandimal lbw with what proved to be the last ball of an eventful day.