England were on the verge of securing a very unlikely draw in the second Investec Test at Headingley, but James Anderson fell to the penultimate ball which meant his and centurion Moeen Ali's last-wicket stand was in vain as the tourists sealed a 100-run win and a historic 1-0 series triumph.
Cook's leadership has been under scrutiny since the 5-0 Ashes whitewash and his position will come under increasing scrutiny following this result, but the left-handed opener insists he is keen to carry on.
"It's a huge honour to captain England and I'm in it for the long haul, as long as I can be, because I believe I'm the right man for the job," said Cook.
"If someone else decides that not the case then so be it, but I've got to give all blood, sweat and tears into the England captaincy. I never quit on anything, I'm a determined bloke and I'm determined to turn this around."
Cook's form with the bat has been a hot topic of conversation as the Essex man has not registered a century in more than a year - a run of 12 Test matches - and has managed just 601 runs in his last 24 innings at an average of 25. The 29-year-old admitted he needs to improve ahead of the five-Test series against India, which gets under way in a fortnight's time at Trent Bridge.
"It's tough, you're there at the top of the order to score runs and when you haven't done it for 12 Test matches it becomes harder and harder," Cook said. "I have to go back to what I know which are my real basics. I've got 10 days of real preparation for India to make sure I'm ready for that.
"I know I've got to score runs. No one's got a divine right to captain a side or play in the side if you're not performing. I've got to go back to doing what I do best which is scoring runs at the top of the order, I've got to work bloody hard over the next 10 days on my game. Hopefully that'll be good enough, if it's not then it's not."
Cook was full of admiration for England's fightback yesterday as they appeared dead and buried in the morning after resuming on 57 for five, with a superbly crafted maiden century from Moeen in just his second Test keeping their hopes alive.
The Worcestershire left-hander scored 108 off 281 balls, which took England to the brink of a draw after he and Anderson resisted Sri Lanka's bowlers for more than an hour before the tail-ender agonisingly succumbed in a thrilling end to the game.
Cook added: "The way we fought there with the bat . . . Mo played an outstanding innings for a guy in his second Test match. We knew we had to fight all day, pretty much shut up shop, and to get 100 like that is a great effort and bodes incredibly well for the future.
"We knew his class, you never know how a guy's going to adapt to international cricket but the way he's handled himself in the last two games, he's a brilliant cricketer in the way he constructed that innings today and he doesn't deserve to be on the losing side. We thought we were getting closer and closer. For Jimmy to survive 80 minutes up there was a great effort; gutting to come up short.
"Credit to Sri Lanka for the way they kept going today, the series was very close and they've just won the crucial moments."
Angelo Mathews was delighted after sealing victory, having played such a crucial part with both ball and bat. The Sri Lanka captain took four wickets in England's first innings before his 160 took the game away from hosts. "It means everything," said Mathews. "We play a lot of cricket in the subcontinent and people don't expect us to come over and win in England and we proved that today. We played some really good cricket."