Oshada Fernando struck a half-century to help Sri Lanka regain lost ground after losing an early wicket against Pakistan on day three of a keenly contested first Test on Monday.
The hosts reached 132 for two at lunch in their second innings to extend their lead to 136 in Galle.
Sri Lanka resumed the day on 36-1. Nightwatchman Kasun Rajitha, who added four to his overnight three, was the first to go when left-arm spinner Mohammad Nawaz trapped him lbw in the second over of the morning.
But Oshada (64) held firm, putting on 91 runs with Kusal Mendis (45) to deny Pakistan any more wickets in the session.
It was Oshada's sixth Test fifty, scored on a pitch that is expected to aid slow bowlers.
Oshada and Kusal had the right mix of caution and aggression, hitting 11 boundaries between them.
Sri Lanka's Prabath Jayasuriya had claimed five wickets on Sunday before Pakistan skipper Babar Azam hit 119 to lead the fightback from a precarious 85-7.
The visitors' first innings ended just four runs short of Sri Lanka's 222.