Left-handed opener Cook, who won the toss and elected to bat, started his innings knowing he needed to make 20 to become the first Englishman and only 12th player in history to score 10,000 Test runs.
But he fell for 15 when, not moving his feet, he was drawn into steering recalled paceman Suranga Lakmal to second slip, where Dimuth Karunaratne held a good, two-handed, diving catch.
Cook’s exit left England 39 for one in the 14th over.
He could still reach the landmark total of 10,000 Test runs if England bat again in this match.
However, England only batted once in the first Test at Headingley last week — a match they won by an innings and 88 runs to go 1-0 up in this three-match series.
If England don’t have a second innings at the Riverside, Cook’s next chance to score his 10,00th Test run will come at Lord’s — the self-styled ‘home of cricket’ — where the third Test starts on June 9.
Should Cook, now 31 years and 154 days old, complete the feat in either of the next two days he would be the youngest batsman of all time to score 10,000 Test runs, lowering the record of India great Sachin Tendulkar (31 years and 326 days).