Chasing 236 in 35 overs, England were wobbling on 152-5 despite a good start by Moeen Ali and Alastair Cook.
But Root (48 not out) and Buttler (55 not out) shared 84 in 10.3 overs to see England home with eight balls to spare.
Sri Lanka, who lead the seven-match series 2-1, earlier reached 242-8, with Lahiru Thirimanne making 62 not out.
That came after Kumar Sangakkara compiled 63 to become only the fourth man to pass 13,000 runs in one-day internationals.
- BBC