At the stroke of Lunch, Sri Lanka were still 55 runs behind with opener Nishan Madushka sniffing a gritty half-century.
The home side, resuming at an overnight score of 14/0, could only add 28 runs to their total before sustaining the first blow.
Abrar Ahmed provided the breakthrough to the touring side as he removed Sri Lankan captain Dimuth Karunaratne by luring him into playing a loose shot. He scored 20 off 27, hitting four boundaries.
Madushka then joined forces with wicketkeeper batter Kusal Mendis and stitched a brief partnership for the second wicket.
The pair added 37 runs amid their stand and put Pakistan in dire need of a wicket.
The breakthrough came in the 25th over of the second innings when Noman Ali trapped Mendis lbw to dent Sri Lanka’s march.
The left-arm spinner then gave Pakistan an edge over Sri Lanka when he struck again eight overs later to get rid of experienced Angelo Mathews.
He bowled a good length ball which turned more than Mathews expected and took a fine nick off his bat and past the keeper. Pakistan captain Babar Azam dove to his left and took a one-handed screamer to mark the end of Mathews’s brief knock.
The right-handed batter could score a mere seven in 21 deliveries and hit a boundary.
Mathews’s dismissal gave Pakistan an upper hand over Sri Lanka, who are still 55 runs in the deficit.
Opening batter Madushka was Sri Lanka’s mainstay amid an eventful first session. He was unbeaten on 47 in 106 deliveries, laced up with six boundaries and a six.
Experienced Dinesh Chandimal, who made a modest contribution in the first innings, was not out on one.
Noman Ali led the bowling attack for Pakistan with two wickets, followed by Abrar Ahmed with one.