Test cricket's top-ranked spinner Rangana Herath skittled Pakistan's top order on way to surpassing the 250-wicket mark to put Sri Lanka on top in the second Test in Colombo on Friday.
The 36-year-old left-arm bowler grabbed five wickets as Pakistan, replying to Sri Lanka's first innings total of 320, were reduced to 140-5 after tea on the second day at the Sinhalese Sports Club.
The sixth-wicket pair of Asad Shafiq and Sarfraz Ahmed stemmed the rot with a 93-run stand that lifted the tourists to 244-6 by stumps, still trailing by 76 runs with four wickets in hand.
Shafiq became Herath's 251st victim, bowled for 42 just before stumps, but Sarfraz remained unbeaten on a fighting 66 in a match the tourists must win to level the two-match series.
Herath, playing his 57th Test, is only the third Sri Lankan bowler to reach the 250-wicket mark after world record holder Muttiah Muralitharan (800) and Chaminda Vaas (355).
Opener Ahmed Shehzad anchored the innings with 58, but his dismissal just before tea turned the tide in Sri Lanka's favour as Pakistan lost four wickets in the space of 30 runs.
Earlier, Sri Lanka's last two wickets added 59 useful runs to the overnight score of 261-8 before the hosts were all out 45 minutes before lunch.
Number 11 batsman Chanaka Welegedara returned unbeaten on 27 after adding 36 for the last wicket with Herath (17).
Left-arm seamer Junaid Khan finished with five for 87, with all his five career five-wicket hauls coming against Sri Lanka.
Fellow seamer Wahab Riaz claimed three for 88.
Herath broke the opening partnership two deliveries before lunch when he had Manzoor caught behind by wicket-keeper Niroshan Dickwella for 23.
Ali looked settled while making 32 when he stepped out against Herath, mistimed the shot and gave Angelo Mathews an easy catch at short mid-wicket.
Shehzad fell soon after, edging a pull off Dilruwan Perera to be caught down the leg-side by the wicket-keeper.
Shehzad was on 37 when he was reprieved by the Decision Review System (DRS) after being given out leg-before off Herath by English umpire Richard Illingworth.