MS Dhoni and Dinesh Karthik pulled off a tight finish for India after captain Virat Kohli laid the foundation with a classy century for a series-levelling six-wicket win against Australia in Adelaide on Tuesday.

Chase-master Kohli could not take his team to the finishing line this time but Dhoni (55 off 54) and Karthik (25 off 14) rose to the occasion with an unbeaten 57-run stand off 34 balls, taking India home with four balls to spare. Australia scored 298-8 after opting to bat.

Man of the match Kohli was dismissed in the 44th over after making 104 off 112 balls with five fours and two sixes — his 39th ODI century. Dhoni, who has been coping a lot of criticism for his waning finishing skills, put in a gritty display full of running and took India past the finish line with a final over six.

The third and final ODI will be in Melbourne on Friday.

Earlier, Shaun Marsh smashed 131 off 123 balls to leave India with a testing run chase.

Marsh hammered 11 fours and three sixes to guide the Australians to 298 for nine after the hosts won the toss to leave India facing the second-biggest run chase in ODIs at the famous Adelaide Oval.

Marsh got to his seventh ODI century and second against India as Australia made the tourists sweat in the field in temperatures hovering around 40 Celsius (104F).

India could have been chasing an even higher total if not for the last three overs from Bhuvneshwar Kumar and Mohammed Shami.

They took a combined four for 17 in the last 18 balls with Kumar claiming the big wickets of Marsh and Glenn Maxwell.

Maxwell had kicked along Australia’s scoring rate with a typically rumbustious knock of 48 off 37 balls coming into bat at No.7.

Skipper Aaron Finch earlier struggled for runs before he was bowled by Kumar off an inside edge for six in the seventh over.

Finch was soon followed by opening partner Alex Carey, who attempted a pull shot off Shami only to balloon a catch to Shikhar Dhawan at mid-wicket for 18, leaving Australia at 26 for two.

Usman Khawaja put on 56 runs for the third wicket with Marsh before he was brilliantly run out by Ravindra Jadeja with a direct throw from cover point for 21.

Peter Handscomb threw away his wicket when he rashly tried to sweep Jadeja but was well beaten and smartly stumped by MS Dhoni on 20.

Marcus Stoinis was caught behind off a short ball from Shami for 29, and Maxwell produced a lively cameo with Marsh before he was caught at long-off by Dinesh Karthik.

Maxwell, who had only faced five balls in Sydney, clubbed five fours and a six.

Marsh followed in similar fashion two balls later when he was deceived by a slower ball from Kumar and lofted to Jadeja at long-off.

The wickets kept tumbling late in the innings with Jhye Richardson caught at deep point by Dhawan off Shami for two and Peter Siddle was out for a first-ball duck caught by Virat Kohli on the run at deep backward point off Kumar.

The Australians lost four wickets for three off 11 balls before Nathan Lyon blasted a six off the final ball.

Kumar finished with four for 45 and Shami three for 58.