England thought they had claimed the win with the penultimate ball when Nuwan Pradeep was given lbw off Stuart Broad, only for the tourists to review and umpire Paul Reiffel reverse the decision.
It would have amounted to a breathtaking finish to a frantic final session in which England took six wickets for 32 runs, seamer James Anderson finishing with figures of 4-25.
Cook conceded, however, that a stuttering batting performance on Sunday and a reliance on a seam-only bowling attack may have cost his team the lead in the two-match series.
“I can’t praise the lads enough. That was a flat wicket, we just had to wait for reverse swing, which took longer than we thought. We gave ourselves a chance and to come up short is frustrating,” he said.
“Possibly we missed a spinner, it might have made the difference. But, at the moment, with the players we have available, this is the way we have to go. We were trying to play positively and gave wickets away. Those four or five wickets on Sunday cost us having half an hour at them that night.”
Sri Lanka skipper Angelo Mathews, whose team were set a record target of 390 to win after England had declared on 267-8, said the scare would act as a warning for the second Test on Friday at Headingley.
“It was a close game. England bowled pretty well, especially after tea, hitting the deck pretty hard and asking questions of our batsmen,” he said. “I thought it was safe but you can’t relax. That’s a good lesson learned.”
Pradeep was quick to ask for a review when England thought they had him snared, and replays showed he had got an inside edge to Broad’s delivery.
More drama was to follow as Pradeep almost fell to the final ball, but his outside edge fell inches short of England fielders waiting in the slips.