England won the second Test by nine wickets with more than a day to spare to go an unassailable 2-0 up in the three-match series.
Set 79 for victory after making Sri Lanka follow-on, England finished on 80 for one. Left-handed opener Cook was 47 not out and Nick Compton, who hit the winning runs 22 not out. His innings saw Cook score the five he needed to become just the 12th player of all time to make 10,000 Test runs.
Fellow opener Alex Hales was 10 not out. Cook reached the landmark when he clipped Nuwan Pradeep for four through mid-wicket, having got off the mark with an edged single against left-arm spinner Rangana Herath. At 31 years and 157 days he was the youngest player ever to achieve the feat, beating the previous record of India great Sachin Tendulkar (31 years and 326 days).
Dinesh Chandimal's excellent hundred kept England waiting as Sri Lanka made 475 in their second innings. Chandimal's 126 was his sixth hundred in 27 Tests but first outside Asia.
He received excellent support from Rangana Herath (61) in seventh-wicket stand of 116. Sri Lanka resumed on 309 for five, 88 runs adrift of England's 498 for nine declared built around Moeen Ali's Test-best 155 not out.
Chandimal was 54 not out overnight and Milinda Siriwardana unbeaten on 35 after Sri Lanka captain Angelo Mathews (80) and Kaushal Silva (60) initially kept England at bay.
Play began Monday under a heavily grey sky. The cloud cover promised ideal conditions for England pacemen James Anderson and Stuart Broad, who were just four overs into a spell with the new ball.
Siriwardana had not added a run to his overnight score when he edged Anderson straight to Alex Hales at gully to end a stand worth 92.
Chandimal, however, cover-drove Broad for four and late-cut Anderson behind point for another boundary. But he was lucky on 69 when he got an inside edge off Anderson only for diving wicket-keeper Jonny Bairstow to spill the catch despite getting both gloves to the ball.
Chandimal went into the 90s when he hooked fast bowler Steven Finn to the fine leg boundary. An edged boundary off Woakes to third man saw the 26-year-old Chandimal to a 172-ball hundred including 11 fours.
Chandimal ended the session in style by cover-driving Woakes for four off the last ball before lunch.
Herath, dropped in the deep by James Vince off Anderson on 46, completed an 87-ball fifty with six fours.
The 38-year-old, who earlier in this match took his 300th Test wicket, eventually fell when Anderson, taking the fielders out of the equation, had him lbw from round the wicket to claim his 450th scalp in the five-day game.
Anderson, already England's all-time leading Test wicket-taker, then bowled Shaminda Eranga. His return of five for 58 was the 21st time Anderson had taken five or more wickets in an innings his 115 Test-career.
Chandimal's more than five-hour innings ended when he was bowled driving at Stuart Broad. But Sri Lanka's batsmen had at least restored some pride.
Their first innings 101 all out meant they became the first side since New Zealand in England back in 1958 to be bowled out for under 120 in three successive Test innings.
Sri Lanka managed meagre totals of 91 and 119 during an innings and 88-run defeat in the series opener at Headingley. The third and final Test starts at Lord's on June 9.