Fast bowler Shaheen Afridi led Pakistan's spirited bowling display with a four-wicket haul to help the touring side skittle Sri Lanka out for 222 on the first day of the opening test in Galle on Saturday.
In reply, Pakistan lost openers Imam-ul-Haq and Abdullah Shafique to reach 24-2 by the close of play, trailing by 198 runs.
The Sri Lanka team, playing amid a political and economic meltdown in the country, came into the contest having defeated Australia by an innings and 39 runs to level their two-test series at the same Galle International Stadium a few days earlier.
On a surface expected to aid spinners as the match progresses, Sri Lanka captain Dimuth Karunaratne did not hesitate to bat first after winning the toss.
But the hosts' hopes of piling up a big first innings total were hit hard when Karunaratne was out for just one.
Kusal Mendis and Oshada Fernando combined for a second-wicket stand of 49 to set up a platform for Sri Lanka's batters to build on, but Pakistan hit back by picking up three wickets for eight runs to reduce them to 68-4.
Experienced leg-spinner Yasir Shah celebrated his return to the Pakistan side for the first time since August by dismissing Mendis for 21 and Angelo Mathews without scoring, while seamer Hasan Ali sent back Fernando for 35.
Former captain Dinesh Chandimal, who smashed an unbeaten 206 to set up the victory against Australia, top-scored for the hosts with 76 and, along with some resistance from the tailenders, saw the side go past the 200-run mark.
Afridi's heroics saw Sri Lanka tottering at 133-8, but Chandimal and Maheesh Theekshana staged a small recovery with a ninth wicket stand of 44 before the former fell to an athletic catch by Shah off Hasan.
Theekshana, who made 38, and number 11 batter Kasun Rajitha continued to frustrate Pakistan's bowlers with a dogged last-wicket stand of 45, much to the delight of the sparse crowd.
But Afridi returned to end the partnership, sending back Theekshana with a short-pitched delivery.