Sri Lanka failed to give him a winning farewell but the cricketer made sure that England earned the final wicket to seal the last game of his career.
Soon afterwards Angelo Mathews - dropped on 18 by James Anderson - went for 53, caught by Jos Buttler at midwicket with Ali again the wicket-taker.
Mathews, meanwhile, also reached his half-century only to prove his critics that he is still the best batsman of the team.
Set a gargantuan 462 for victory, the hosts ended the morning session on 98 for 3, after their openers had earlier batted out the first hour of play.
Less than three overs later Karunaratne decided he would take the aerial route against Moeen, an ill-judged scheme that saw him club a firm return catch back at the off-spinner.
Dhananjaya de Silva, after a confident start, was caught at first slip by Root off Stokes in the last over before lunch for 21.
He didn't field during England's second innings on Thursday, and batted in pain for scores of 33 and 1. Chandimal, who was nursing a groin strain, could miss the second test at Pallekele next week.
England had not won in 13 Tests, had never won in Galle and had had a miserable time in Bangladesh and India in similar conditions. They have had tremendous support here, with 5,000 England fans in Galle, and they did a lap of honour after their victory which was nice.
England wicketkeeper Ben Foakes was named Man of the Match after scoring a century in his maiden Test innings, which could leave the tourists with a selection headache of their own.
Jennings' second Test ton was neither pretty nor dynamic - and offered no clues about how he might reverse his struggles on seaming decks at home - but it was a study in concentration, the kind of effort England might have feared had headed for retirement with Alastair Cook.
Hathurusingha was not unhappy with Sri Lanka's positive intent, even when they were batting to save a Test.
"It's a hard day for us, because we know how much Rangana has done for the team and Sri Lanka cricket..."
Herath retired from global cricket as one of the most successful Lankan bowlers in Tests after Muttiah Muralitharan who scalped 800 wickets.
"It's a bit of an emotional situation but everyone has to take a decision at the right time so I'm thankful for all the years that I've played and all the people who were behind me, especially my teammates and Sri Lanka Cricket".