Manish Pandey and MS Dhoni, rising star and fading force, combined to deliver India victory over Australia at the last possible opportunity in another run-fest at the SCG.
Having crumpled in a humiliating heap in Canberra, the tourists were able to hold their nerve this time, helped by a pair of critical Australian dropped catches.
David Warner and Mitchell Marsh had made centuries for Australia, but the allrounder conceded 13 from the final over of the night to allow the visitors avoid the ignominy of a 5-0 series sweep.
It also provided partial vindication of Dhoni's longtime belief in seeing out an innings, even if his steady 34 was a diminished version of supreme closing displays he used to be able to put together for his team. Australia were denied an unbeaten home summer.
Fluent hands from Shikhar Dhawan and the Man-of-the-Series Rohit Sharma had put India in sight of victory though both men fell short of centuries.
Dhawan was brilliantly caught by Shaun Marsh at deep point, before Rohit reached 99 only to edge John Hastings behind and be given out by the umpire Paul Wilson after a dramatic pause for the crowd of 33,710.
Pandey, playing his fourth ODI, weathered that moment and pushed on to his highest and best innings for India. His crisp stroke play found plenty of gaps around the SCG and kept the run chase within sight. Dhoni arrived at the fall of Rohit's wicket and after a halting start India's captain gradually found his range in time-honoured fashion.
The pair allowed the equation to leak out to 35 to win from the final three overs, before taking 13 from the 48th over and nine from the 49th. Needing 13 from the final over, Mitchell Marsh gave away a wide first ball, before Dhoni hammered a six over long off.
He then perished trying to repeat the shot, but Pandey squirted a boundary past the gloves of Matthew Wade to reach a deserved hundred and put the result beyond doubt.