Trailing for most of the match after being all out on the opening day for 183, the hosts scythed through the Indian order with 37-year-old Herath adding six wickets to his overnight dismissal of opening batsman Lokesh Rahul for his 22nd five-wicket haul in tests.
Off-spinner Tharindu Kaushal, who took five wickets in the first innings, provided superb support by picking up three more in the second innings as India, who resumed the day on 23-1, were shot out for 112 an hour after lunch.
Ajinkya Rahane (36) was the only Indian batsman to provide some resistance but he too fell to Herath, edging the wily spinner to home captain Angelo Mathews at slip.
Sri Lanka looked dead and buried on 95-5 on Friday after conceding a first-innings lead of 192 but Dinesh Chandimal’s swashbuckling unbeaten 162 allowed them to stage a fightback and set India a victory target of 176.
The hosts, who lost their last test series at home to Pakistan, put immense pressure on India with tight bowling and some smart catches.
India failed to find scoring opportunities, with first-innings centurion Shikhar Dhawan, unbeaten on 13 overninght, taking 36 balls to score his first run in the morning.
That came from a streaky four with the ball narrowly missing the leg stump after taking an edge.
Herath, who has been off form lately and went wicketless in the first innings, struck with his first ball of the day, sending nightwatchman Ishant Sharma out leg before.
He also accounted for the wickets of Rohit Sharma, wicketkeeper Wriddhiman Saha, Harbhajan Singh and Ravichandran Ashwin, while Kaushal picked up India captain Virat Kohli and then took a sharp return catch to send back Dhawan.
Amit Mishra was the final man out to Kaushal, sparking wild celebrations by the Sri Lankans.
The second test, the last for retiring Sri Lankan batting stalwart Kumar Sangakkara, will start on Thursday in Colombo.