Sri Lanka are well top in the second Test, requiring 153 runs to win on the final day against Pakistan.
Pakistan trailed by 177 runs after their first innings, before being bowled out for 329 in their second dig yesterday.
The tourists were in a good position at 5-300 as they looked to build a competitive lead for Sri Lanka to chase down. However, they lost their last five wickets for just 28 runs, leaving Sri Lanka just 153 runs to chase down on day five.
Sri Lankan paceman Dhammika Prasad took four wickets for the hosts to help them continue a dominant display and set up a likely victory on the final day.
Pakistan batsman Azhar Ali scored 117, while Shehzad (69) and Khan (40) proved the only other resistance, with the rest of the top order collapsing around them.
Centurion Azhar Ali said that despite the modest target, Pakistan still had a chance of winning the match.
"This kind of a total can be a bit dodgy because we can come back with a few early wickets," he said.
"We could have been in a better position if we had not lost wickets at a crucial stage.
"We should have got a lead of around 230 or 240. Still, there are runs on the board to defend. There is a lot in this pitch for spinners and if they bowl in the right areas, anything can happen tomorrow."
See the full scorecard at Cricket.com.au