After opener Kaushal Silva hit 125 to lift Sri Lanka to 300 in the first innings, Pakistan collapsed to 35-3 in reply before a partial recovery saw them to 118-5 by stumps.
Asad Shafiq was unbeaten on 14 and Sarfraz Ahmed was on 15 when rain forced play to end early with the tourists trailing by 182 runs with five wickets in hand.
Seamer Dhammika Prasad removed both openers by the third over, paving the way for the bowlers to take control of the innings on what remained an easy-paced pitch at the Galle International stadium.
Prasad had Mohammad Hafeez caught at third slip off his sixth delivery and then trapped Ahmed Shehzad leg-before in his next over to reduce Pakistan to 11 for two.
It became 35-3 when seasoned left-arm spinner Rangana Herath, brought in to the attack in the sixth over, had Azhar Ali leg-before in his third over.
Veterans Younis Khan (47) and skipper Misbah-ul Haq (20) attempted to rebuild with a 51-run stand for the fourth wicket before both were dismissed in the space of 10 runs in the last session.
Younis was bowled as he stepped out to drive off-spinner Dilruwan Perera, and Misbah fell to a brilliant one-handed diving catch at first slip by 37-year-old Kumar Sangakkara off Nuwan Pradeep.
Sri Lanka's innings were built around Silva's painstaking effort that was marked by solid defence even as wickets tumbled regularly at the other end.
The diminutive right-hander lit up the rain-hit Test with a stubborn 125, his second Test century after making 139 against Bangladesh in Dhaka in January last year.
Silva, however, failed to carry his bat through the innings when he was ninth out from the 300th delivery he faced, caught behind off left-arm spinner Zulfiqar Babar.
Silva, who began the day on 80, had reached his century 30 minutes before lunch when he drove Babar through the covers for his 15th boundary.
Bad weather had washed out the entire first day's play on Wednesday and just 64 overs were bowled on the second day due to a wet outfield.
Sri Lanka added 11 runs to their overnight score of 178-3 when they lost the wicket of skipper Angelo Mathews, who was bowled by left-arm seamer Wahab Riaz for 19.
Dinesh Chandimal contributed 23 in a fifth-wicket stand of 37 with Silva before being bowled by Babar, who was surprisingly handed the second new ball which was claimed after 80 overs.
Kithuruwan Vithanage was the third batsman to be dismissed in the morning session when, on 18, he gave Hafeez an easy return catch.
Babar removed Prasad and Silva in successive overs before Yasir Shah held a skier off his own bowling to dismiss last man Nuwan Pradeep.
Wahab and Babar finished with three wickets each, while Hafeez and Shah took two each.
The three-Test series will be followed by five one-day internationals and two Twenty20 matches.
Original source: SL has Pakistan on the backfoot