The tourists were wobbling at 152-5 despite a fluent 58 from opener Moeen Ali, during which he clobbered five sixes, before half-centurion Jos Buttler and Joe Root shared an unbeaten 84 in 10.3 overs to seal victory with eight balls remaining and relieve the pressure on the embattled Cook.
England were chasing a revised 236 in 35 overs after Sri Lanka posted 242 from their ran-affected allocation, with Kumar Sangakkara top scoring with 63 to pass 13,000 ODI runs while late pyrotechnics by Lahiru Thirimanne helped add 62 in the final five overs.
Victory was only England’s eighth in 23 completed ODIs against Test-playing nations and reignites the seven-matches series at 2-1, although a wayward bowling performance – Ben Stokes, Ravi Bopara and Root conceded 73 runs in seven overs – and middle-order collapse proved concerning for Cook.
“It was great to get over the line,” said Cook. “We probably made it a little bit harder for ourselves than we should have done. We obviously got a great start with Mo [Moeen] and were cruising but it was a great little knock by Jose [Buttler] and Rooty [Root] to get us over the line.
“They took the power-play a couple of overs earlier so we had to use our main quicks early and our fifth bowler didn’t quite get it right but we thought 235 was about par and if we batted well we should get there.”
Cook could be hit with a suspension should England be found guilty of a slow over-rate. He was fined for a similar offence following a one-day clash with India in August and warned that any repeat in the ensuing 12 months would result in a ban.
The Essex opener faced renewed calls to resign after a deflating defeat in Colombo on Saturday while his place at the top of the order was also the subject of intense scrutiny heading into the third ODI, although are a more assured and fluent 42-ball 34 provided some welcome relief.
“It was nice to score a few runs but disappointing to get out when I did because we were getting onto a good partnership,” added Cook.
“We probably were a little bit slow but it’s hard when the ball goes everywhere and it’s such a big ground that it takes a long time for the batters to come out so hopefully people will be kind.”