Shikhar Dhawan's 10th ODI hundred and half-centuries from Rohit Sharma (78) and MS Dhoni (63) had taken India up to 321-6 but it proved insufficient after a remarkable Sri Lankan batting effort.
A stand of 159 between Danushka Gunathilaka (76) and Kusal Mendis (89) set the platform for the victory and, after both were run out, captain Angelo Mathews (52no) guided the side home - making light work of it in the end as they completed the win with eight balls to spare.
The result means that all four teams in Group B are level on two points with the winners of the round of fixtures to progress to the last four.
The day began with a cautious opening from Rohit and Dhawan after India had been put in by Sri Lanka but the pair started to move through the gears towards the end of the powerplay.
Before long, Rohit was in full flow and brought up his half-century with a six pulled over square leg, adding another maximum later in the over for good measure.
It was the pull shot that eventually brought his downfall though as he picked out fine leg, taking on Lasith Malinga's bouncer.
Kohli fell for a duck in the next over, caught behind off Nuwan Pradeep (1-73) as he tried to run the ball down to third man.
Unfazed by the two quick wickets, Dhawan went on the counter-attack, a flurry of boundaries making clear that India remained well on top.
Asela Gunaratne (1-7) removed Yuvraj (7); the experienced left-hander trying to dig out a full delivery but seeing the ball bounce up off the toe-end of his bat and dislodge the off bail.
That brought Dhoni to the crease and he and Dhawan were soon flaying the ball to all parts of The Oval before Malinga (2-70) had the opener caught at long on.
Dhoni progressed to his fifty and even after his dismissal in the final over, Kedar Jadhav (25no from 13 balls) ensured the innings ended with a flourish.
And Sri Lanka's hopes of a successful chase took an early blow as Niroshan Dickwella got a leading edge to Ravindra Jadeja at backward point, trying to whip Bhuvneshwar Kumar (1-54) through the legside.
While Gunathilaka was going at around a run a ball throughout his innings, Mendis started slowly but between them they built a partnership that put Sri Lanka in the ascendancy.
Both batsmen were finding the boundary regularly and their ever-growing confidence was shown as they each reached their half-centuries with maximums.
However, just as it looked as though they would coast to victory, a needless run out saw Gunathilaka trudging back to the pavilion.
Mendis continued merrily on his way and a century looked to be his for the taking before another crazy run out, just five overs later, sent him back to join Gunathilaka and threatened to derail the Sri Lanka innings.
Kusal Perera was perhaps the guilty party in Mendis' dismissal, calling him through for a single that was never on, but he did his bit to make amends, helping Mathews to continue the Sri Lankan charge.
There was another twist though, as, having made 47 from 44 balls, Perera battled on for a number of overs but was finally forced from the field with a hamstring problem.
Gunaratne (34no) was the man thrust into the battle and after failing to score from his first three balls, he eased the nerves of the Sri Lanka fans with a six, hoisted high over deep backward square.
It was left to Mathews to hit the winning runs though, a single doing the job after a fantastic four down the ground had levelled the scores, bringing up his fifty in the process.
India face South Africa on Sunday and Sri Lanka now take on Pakistan on Monday with the winners of each game qualifying for the semi-finals.