Pakistan spinners Mohammad Nawaz and Yasir Shah hurt Sri Lanka's batting but the hosts stretched their second innings lead to 261 on day three of a keenly contested first Test on Monday.
Sri Lanka were 257 for seven at tea with Dinesh Chandimal, on 34, and Ramesh Mendis, on 19, batting on a turning pitch at the Galle International Stadium.
Nawaz claimed four wickets with his left-arm spin while veteran leg-spinner Yasir had three. Kusal Mendis made 76 and opener Oshada Fernando scored 64 and put on a key third-wicket stand of 91 to fight back after an early wicket in the morning session.
Oshada reached his sixth Test fifty in the first session but fell to Yasir's leg spin on the second ball after lunch. Kusal raised his fifty and took on the opposition attack with a few boundaries before Yasir bowled him with an unplayable delivery that pitched outside leg and turned to hit the top of off stump.
Nawaz, who got nightwatchman Kasun Rajitha on the third ball of the day, combined with Yasir as the two dented the opposition middle order. 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.