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.
Shehzad had put on 47 for the first wicket with Khurram Manzoor and 63 for the second with Azhar Ali to lift the total to 110-1 before the collapse on either side of tea.
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.
Veteran Younis Khan, who hit a century in the first Test, was dismissed in the third over after tea when a defensive shot off Herath struck the batsman's left boot and lobbed to silly-point.
Kaushal Silva, the fielder close to the wicket, dived for the ball and pushed the ball in the air for Dickwella to complete the catch behind the stumps.
Skipper Misbah-ul Haq departed three overs later, edging Herath for Dickwella to hold his fourth catch in the innings, give the bowler his 250th wicket, and reduce Pakistan to 140-5.
Sri Lanka won the first Test in Galle by seven wickets.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ
Pakistan Cricket What Doing 15 August 2014. Misbah Ul haq is doing wrong. Pakistan captain is not doing http://thisreals.com/pakistan-cricket-15-august-2014.php