After being put in to bat, Sri Lanka reached 236-8 in the allotted 50 overs thanks to a gritty 58 by Milinda Siriwardana who struck a crucial 91-run sixth-wicket stand with Chamara Kapugedara, who made 40.
Fast bowler Jasprit Bumrah took four wickets while leg-spinner Yuzvendra Chahal got two.
In reply, the Indian opening batsmen faced no trouble as they motored to 109 runs in 15 overs without losing a wicket. However, leg-spinner Akila Dananjaya changed the complexion of the match as he made quick inroads into the Indian batting line up starting with the half-centurion Rohit Sharma.
Sharma was soon joined by his opening partner Shikhar Dhawan, who was dismissed by Siriwardana for 49. The loss of the two openers triggered a batting collapse as Dananjaya claimed five more wickets for just 17 runs, reducing India to 131 for 7.
However, Dhoni and Kumar stopped the slide and put on an unbeaten 100-run stand to help their team overhaul Sri Lanka’s total.
Man of the match Dananjaya returned career-best figures of 6-54.
“Quite an exciting game of cricket… Something that gave us a tough test, but good to come through eventually,” India captain Virat Kohli said.
The third ODI is scheduled for Sunday at the same venue.