Sri Lanka seized the momentum on Friday as their bowlers reduced Pakistan to 118-5 at stumps on the third day of the first Test at Galle.
The visitors required 33 more runs to avoid follow-on before rain brought a pre-mature end to the day's play.
Resuming at an overnight position of 178-3, Kaushal Silva held the innings together despite wickets kept falling at the other end.
Silva smashed 125, his second Test century, while he received some support from Angelo Mathews (19), Dinesh Chandimal (23), and Kithuruwan Vithanage (18).
Sri Lanka were eventually bundled out for 300 as Wahab Riaz and Zulfiqar Babar claimed three wickets each.
In reply, Pakistan suffered early blows and were reeling at 35-3 in their 9th over. Fast bowler Dhammika Prasad claimed the wickets of Mohammad Hafeez (2) and Ahmed Shehzad (9).
More From This Section
Azhar Ali was subsequently trapped lbw by Rangana Herath before veteran batsman Younis Khan and captain Misbah-ul-Haq steadied the ship by putting together a 51-run partnership for the fourth wicket.
However, the dismissal of Younis and Misbah in quick succession put the visitors in a critical situation at the close of day's play.
Asad Shafiq (14 not out) and Sarfraz Ahmed (15 not out) will resume their innings on the fourth day.