DUBAI: Paceman Wahab Riaz grabbed four wickets and left-arm spinner Haris Sohail took three to dismiss Sri Lanka for 96 in their second innings on the fourth day in the day-night Test in Dubai on Monday.
Riaz, who had taken three wickets on Sunday, finished with 4-41 while Sohail grabbed his three in one over to give Pakistan a target of 317 to win the Test and level the series.
Sri Lanka had won the first Test by 21 runs in Abu Dhabi.
Pakistan needed early gains and Riaz provided them with the important wicket of Niroshan Dickwella in the fifth over of the day for 21.
Leg-spinner Yasir Shah dismissed Dilruwan Perera for naught to leave Sri Lanka in danger of being dismissed for their lowest ever total of 71 against Pakistan.
But Kusal Mendis (29) and Rangana Herath (17) added 35 for the eighth wicket to frustrate Pakistan but Sohail struck thrice in his only over to give his team hope of an upset win.
Shah finished with 2-47.
When Pakistan resumed at 51-0, paceman Lahiru Gamage who took his first wicket in Test cricket, bowling Shan Masood through the gate after the opener had made 16.
Sami Aslam was trapped leg before by Perera for 39 to leave Pakistan two down with 65 runs on the board.
Asad Shafiq fell for 12 when he edged Lakmal to slip to continue his wretched form in the series. Babar Azam made eight.
Lakmal finished with 2-41 while Gamage had figures of 2-38.