India now lead five-match series 2-0.
Batting first, Sri Lanka scored 274 for eight in stipulated 50 overs with skipper Angelo Mathews scoring 92. In reply, India never looked in any sort of trouble as they chased down the target with minimum fuss in only 44.3 overs.
With Virat Kohli promoting him at No 3, the 29-year-old Rayudu justified his skipper's faith scoring an unbeaten 121 off 118 balls with the help of 10 fours and four sixes in an innings that was paced perfectly.
Fittingly enough, it was Rayudu, who finished the match with an inside out boundary off leggie Seekkuge Prasanna.
Also Read
With this century, 29-year-old Rayudu became the fourth oldest Indian batsman to score his maiden ton in ODIs after Sunil Gavaskar, Mohinder Amarnath and Robin Singh.
Growing in confidence after reaching his half century, Rayudu lofted Dhammika Prasad for his third six when in the 80s, then confidently smote off spinner Suraj Randiv for another maximum in his 90s before reaching the coveted landmark with a single to square leg.
Having taken two catches and also effected a run-out, Rayudu deservingly won the man-of-the-match award.
The Guntur-born batsman first steadied the ship after the cheap dismissal of Ajinkya Rahane to stitch the first century stand with Dhawan, whose 79 off 80 balls was laced with 1 six and 7 fours.
The two teams now head to Hyderabad for the third match of the series to be played on November 9.