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.
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.
Sri Lanka's tail adds useful 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.
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
