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.
"What an absolute turnaround it was," home captain Angelo Mathews said at the presentation ceremony. "I thought Chandimal was outstanding. He single-handedly got us a fighting score.
"We were down and out for past three and half days and we had to give it our best shot."
The hosts, who lost their last Test series at home to Pakistan, put immense pressure on India with tight bowling and some smart catches in the first session on Saturday.
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.