Cook scored 47 not out as England eased to their target of 79 after Dinesh Chandimal made a fine century to lift Sri Lanka to 475 in their second innings on the fourth day.
Having been bowled out for 101 first time round, however, the tourists only delayed the inevitable and England took an unassailable 2-0 lead in the three-match series with a day to spare.
“It’s a very special moment for me, but the game is not about personal milestones, it’s about winning games and scoring runs to do that,” Cook said.
“But it’s a real special day and it’s great that my family are here to see me do it.”
Sri Lanka had resumed on 309 for five and England’s only success in the morning session was the dismissal of Milinda Siriwardana for 35, well caught by Alex Hales at third slip off James Anderson to end a sixth-wicket partnership of 92.
Anderson found the inside edge of Chandimal’s bat when the right-hander was on 69 but wicketkeeper Jonny Bairstow spilled a simple chance and the 26-year-old took full advantage, reaching his sixth test hundred with a thick outside edge for four off Chris Woakes.
He received excellent support from Rangana Herath in a seventh-wicket stand of 116, Herath making a breezy 61 before he was trapped lbw by Anderson, the England fast bowler’s 450th test victim.
Anderson bowled Shaminda Eranga for one to complete another five-wicket haul and Stuart Broad ended Chandimal’s defiant knock on 126 with a clever slower ball that clipped the top of his off stump.
Suranga Lakmal was the last man out, skying a catch to Broad off Woakes.
Cook, needing five runs to get to 10,000, clipped Nuwan Pradeep to the mid-wicket boundary to reach the milestone before raising his bat to all corners of a sparsely-populated ground.
Hales was bowled by spinner Siriwardana for 11 but Cook calmly completed the job with Nick Compton, who finished unbeaten on 22 as he battles to retain his place at number three in the order.
“Broad and Anderson are world-class bowlers and you’ve got to show a lot of skill to handle them,” Sri Lanka captain Angelo Mathews said.
“It’s just the Sri Lankan fight that we’ve lost in the past couple of weeks and we’re looking to bring back. There were lots of positives in the last couple of days, Chandimal and Herath showed a lot of character.”