Both the finger spinners claimed four wickets each, as Sri Lanka folded for 284 in pursuit of a 327-run target, Ali returning 4/92 and Leach 4/72.
England had things in control for the most part of the innings, except when last man Malinda Pushpakumara decided to go all swish-and-swing. He came out to bat at No.11 when the hosts needed 101 runs to win, and remained unbeaten on a 40-ball 42, making the visitors sweat for a little while.
Pushpakumara and his skipper, Suranga Lakmal, added 58 runs for the final wicket before the latter was trapped LBW by Leach in the first over after tea. The match thus ended in anti-climatic fashion, with England securing the win after a spunky effort from the final pair.
Earlier in the day, Sri Lanka took guard at 53/4, with Danushka Gunathilaka, Dhananjaya de Silva, Dimuth Karunaratne and Angelo Mathews back in the hut already. Kusal Mendis was at the crease on 15, with night-watchman Lakshan Sandakan keeping him company.
Sandakan showed fight with the bat, surviving 71 deliveries before falling to Leach in the 10th over of the morning. Roshen Silva then joined Mendis in the middle, and the duo put up a partnership of grit and resistance, making it difficult for the visitors to break through.
Mendis, who looked unperturbed on the face of a mammoth target, notched up his seventh Test half-century before lunch, which, more importantly, was his first 50-plus score in 12 innings.
Silva played second fiddle to perfection, following up on his impressive 85 in the second Test. The pair added 102 runs for the sixth wicket and it seemed like the hosts might find a way to salvage some pride in this final Test. However, it all went downhill after Mendis fell to a run out in the 58th over of the innings.
Silva flicked the ball to square-leg, and decided to run a two, assuming that the fielder – Leach – would have a shy at the striker's end. However, the throw came at the non-striker's end, where Mendis struggled to make his ground and was caught short of his crease to depart for 86.
So ended Sri Lanka's best effort in the innings, giving England the breakthrough they were searching for since Sandakan departed.
The wickets kept falling, Silva becoming the ninth man out for 69 with the total at 226, and the English getting ready to celebrate. Pushpakumara and Lakmal, however, delayed it for a while, before finally going down.