The hosts, set a victory target of 386, were bowled out for 268 after tea on the fifth day at the Sinhalese Sports Club in Colombo to hand the tourists a 2-1 series scoreline.
Sri Lanka were revived by a 135-run stand for the sixth wicket between Mathews and debutant Kusal Perera, but the dismissal of both batsmen on either side of tea sealed their fate.
Off-spinner Ravichandran Ashwin finished with four for 69 and was named man of the series for taking 21 wickets in the three Tests.
Seamer Ishant Sharma took three wickets in the innings, including the vital scalp of Mathews after tea, to take his tally to 200 wickets in his 65th Test.
India had fought back after losing the opening Test in Galle by 63 runs to win the second at the P. Sara Oval in Colombo by 278 runs and then took the enthralling final Test in the last session of play.
India’s last series success in Sri Lanka came under Mohammad Azharuddin’s captaincy in 1993 when they won 1-0.
‘A bit of history’
Virat Kohli, enjoying a series win for the first time as Indian Test captain, said he was delighted to see the team bounce back after losing the first match.
“Being 0-1 down was never easy,” he said. “I was told it had never been done before by us abroad, so we managed to create a bit of history.
“It feels nice, especially with such a young team early in our careers, to achieve a magnificent milestone and win a series here for the first time in 22 years.
“The attitude has been brilliant. That is why we are playing the kind of cricket we are playing. There are areas we want to improve on, but the number of bad sessions we had in the series were few. I am really proud of the boys.”
Sri Lanka had slipped to a shaky 107-5 before lunch when Mathews and Perera joined hands to bat out a major part of the afternoon session and lift the hosts to 249-6 by tea.
Mathews made 110, his seventh Test century and the second in successive matches after scoring 102 in the second Test, before he was trapped leg-before to Sharma in the first over after tea with the second new ball.
Left-handed Perera followed his 55 in the first innings with 70, becoming only the second Sri Lankan after Dinesh Chandimal to score two half-centuries in his debut Test.
Perera looked set for a bigger score when he was dismissed shortly before tea, playing a reverse sweep off Ashwin straight to Rohit Sharma at point.
India grabbed the last five wickets for 26 runs after Sri Lanka were sailing at a comfortable 242-5 before Perera’s dismissal.
Sri Lanka began the final session with a reasonable hope of surpassing the difficult target — needing 137 runs more with a possible 36 overs remaining — but India tightened the screws after tea to emerge victorious.
Mathews said he was disappointed after gaining the advantage of winning the toss and asking India to bat first on a seaming wicket.
“We got them to bat in demanding conditions, that is why we are very disappointed at losing,” he said.
“Our batting flopped again although the bowlers were outstanding. India batted well but our batting in the first innings was crucial. We needed to get close to 300.
“If Kusal and I had stayed a bit longer at the crease today, it could have been a different story. But India bowled well in the end.”
India next host South Africa for a full tour in October, while Sri Lanka play a home series against the West Indies at the same time.