England 498 for 9 dec (Moeen 155*, Hales 83, Root 80, Pradeep 4-107) and 80 for 1 (Cook 47*) beat Sri Lanka 101 (Broad 4-40, Woakes 3-9, Anderson 3-36) and 475 (Chandimal 126, Mathews 80, Herath 61, Silva 60, Anderson 5-58) by nine wickets
Alastair Cook finally reached the 10,000-run landmark, the 12th man to do so in Test history, as England secured a nine-wicket victory to take the series although not without some significant toil. Dinesh Chandimal's sixth Test century, and first outside Asia, had continued Sri Lanka's batting resurgence before they were bowled out for 475 to leave a target of 79.
Cook reached his milestone, which has been within his grasp since the South Africa series in January, in quite apt, understated, fashion with a nudge off his pads off Nuwan Pradeep which trickled into the midwicket boundary. He responded with a sheepish grin and a wave of the bat to the dressing room and crowd. Freed from the burden of the approaching record, he finished with a comfortable unbeaten 47 as victory came 45 minutes after tea.
Yet, that it took England until the final session of the fourth day to complete the win - having enforced the follow-on 397 ahead early yesterday morning - was huge credit to Sri Lanka who batted for 128.2 overs in their second innings. The fightback was started by Kaushal Silva, energised by Angelo Mathews then carried forth by Chandimal.
Chandimal added 116 in 29 overs for the eighth wicket with Rangana Herath who contributed a lively 61 - the second fifty of his Test career - before James Anderson completed a hard-earned five-wicket haul to take him to 18 wickets in the series. His previous scalps in the series had been handed to him rather easily, but in this innings he showed his full repertoire of skills, extracting seam movement from a docile surface and using the angle from round the wicket. He was named Man of the Match.
Chandimal's hundred came from 172 balls when he guided Chris Woakes through gully - after a nervy nine deliveries on 99 - following the reshuffle of Sri Lanka's order for the second innings which saw him slip down to No. 6.
He was given a life on 69 during the morning session when Jonny Bairstow shelled an inside-edge offered from the bowling of Anderson, but he batted with a conviction that had been lacking in the previous innings. The celebrations were expansive, a roar of emotion with an extended salute to the dressing room and after losing Herath he began to further open his shoulders, striking Moeen Ali for a straight six, before being bowled when he swiped at an off-cutter from Stuart Broad.
The day resumed with the new ball just four overs old and England struck in the fifth over of the day when Milinda Siriwardana edged Anderson to gully to end a seventh-wicket stand of 92. But there was no hustling through the lower order as Herath brought back memories of his crucial innings at Headingley in 2014 when he put on the series-defining stand with Mathews.
Apart from the occasional variable bounce, the pitch was as true for batting as at any stage in the match, a point highlighted as Herath started to pick off boundaries including two sweetly-struck pulls. Steven Finn, who bowled a laboured three-over spell, was taken for 11 in four deliveries by Herath. Finn spoke honestly the previous evening about his search for form - while Ottis Gibson, the bowling coach, said before play that he was a bowler who stressed too much on negatives rather than positives - but he looked no closer to finding the answer.
Herath started to have some fun after lunch, including reverse-sweeping Moeen, as he brought up his half-century from 87 balls. He was dropped on 46 when James Vince spilled a skier running back from cover but eventually fell playing around a full delivery from Anderson who then added Shaminda Eranga by knocking back the off stump to claim his fifth wicket.
The last-wicket pair, Suranga Lakmal and Pradeep, had a bit of a swing as they added a further 22 runs before Lakmal top-edged to mid-on to give Woakes his second wicket. England's bowlers will be grateful for the longer break before the final Test at Lord's.
The chase was a largely serene affair with Alex Hales, bowled when playing back to Siriwardana's left-arm spin, the only casualty. Nick Compton stayed with Cook to knock off the target, a little boost to his confidence after two first-innings failures in the series, and he was named as part of an unchanged squad for the final Test. So it was job done for England, this time with one day to spare but though the series has gone Sri Lanka will head south to slightly warmer climes - and a traditionally good batting wicket at Lord's if the sun shines - with self-esteem restored.
Andrew McGlashan is a deputy editor at ESPNcricinfo