Paceman Jasprit Bumrah laid the foundation for India's victory with a career-best 5-27 to help restrict Sri Lanka to 217-9 at the Pallekele International Cricket Stadium.
India slumped to 61-4 in 14 overs but Sharma and Mahendra Singh (MS) Dhoni accomplished the chase with an unbroken 157-run stand to put India 3-0 up in the five-match series.
Sri Lanka to play T20I in Pakistan, confirms board's chief
The match was held up towards the end when irate fans, who have been protesting since India blanked Sri Lanka 3-0 in the preceding test series, hurled water bottles and forced the players off the ground for about half an hour.
Earlier, Sri Lanka stand-in captain Chamara Kapugedera won the toss but the hosts did not get the kind of start they needed.
Bumrah dismissed Niroshan Dickwella and Kusal Mendis to reduce Sri Lanka to 28-2 before Lahiru Thirimanne and Dinesh Chandimal tried to steady the innings.
India to host Sri Lanka for three Tests, ODIs and T20Is
Once all-rounder Hardik Pandya dismissed Chandimal for 36, Sri Lanka lost wickets at regular intervals and did not get any significant partnership.
Bumrah dismissed Thirimanne for 80 and accounted for the wickets of Akila Dananjaya and Milinda Siriwardana.
India started their reply weakly as Opener Shikhar Dhawan dragged a Lasith Malinga delivery on to his stumps and skipper Virat Kohli flicked Vishwa Fernando to the long leg fielder.
Dananjaya's six-wicket haul had nearly derailed India's chase in the previous match and the off-spinner dismissed KL Rahul and the Kedar Jadhav cheaply to rekindle Sri Lanka's hopes of staying alive in the series.
Sharma's sensible batting, in the calming presence of former captain Dhoni, snuffed out home hopes as they calmly guided India home.
Sharma's 12th ODI century included two sixes and 16 boundaries, whereas Dhoni hit a six and four fours in his 67 not out.
The teams now move to Colombo for the fourth one-dayer on Thursday.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ