India avenged their Mumbai mauling with a 36-run defeat of Australia in the second ODI in Rajkot to level the series.

The tourists had embarrassed India in the first match, cruising to a 10-wicket win with unbeaten centuries from David Warner and Aaron Finch.

India posted a more challenging total of 340-6 on Friday, featuring 96 from Shikhar Dhawan, 80 from KL Rahul and Virat Kohli's 78, to give Australia a tricky chase and they fell short on 304 all out to set up a series decider in Bengaluru on Sunday.

At 220-3 with more than 12 overs remaining, Australia were firmly in the hunt, but India's bowlers got on top and the tourists did not recover from losing Steve Smith, whose 98 was the fulcrum of their innings.

Smith played on to give Kuldeep Yadav his second victim in the 38th over after dismissing Alex Carey to bring up 100 ODI career wickets.

Warner had earlier been dismissed for just 15, flicking at a length ball from Mohammed Shami (3-77) outside off stump and caught spectacularly above his head by Manish Pandey at cover.

Finch fell for 33 and Marnus Labuschagne made 46 in his first ODI knock, but Australia's hopes of a late flurry were savaged by Shami yorking Ashton Turner and Pat Cummins with the first two deliveries of the 44th over before Navdeep Saini and Jasprit Bumrah mopped up the tail.

Dhawan and Rohit Sharma had earlier put on a run-a-ball 81 for India's first wicket, before the latter fell for 42, pegged lbw by leg-spinner Adam Zampa.

Dhawan and Kohli kept the runs flowing, with their stand of 103 eventually broken when Dhawan, four short of an 18th ODI century and looking to reach three figures with one blow, was caught at fine leg by Mitchell Starc off Kane Richardson.

India had collapsed from 134 for one to 255 all out in Mumbai, but this time it would be a different story.

The classy Kohli scored at just over a run a ball before becoming the second of three victims for Zampa (3-50), before Rahul injected late pace into the scoring by plundering his 80 from 52 balls, clearing the ropes three times before being run out in the final over.

A blow for India on an otherwise positive day came with Dhawan taking a blow to the ribs when batting that prevented him from fielding.