India's captain Mahendra Singh Dhoni walks off the ground after winning the second one-day international against South Africa in Indore, on Wednesday.

AFP/Indore

Indian captain Mahendra Singh Dhoni led from the front as the hosts fought back to stun South Africa by 22 runs in the second one-day international in Indore on Wednesday.

India, restricted to 247-9 after electing to take first strike in good batting conditions, hit back to bowl South Africa out for 225 and level the five-match series 1-1.

A relentless display of pace and spin bowling by the tourists had reduced India to 124-6 before Dhoni smashed an unbeaten 92 off 86 balls to help the hosts recover to a more respectable total.

Dhoni added 41 for the seventh wicket with Bhuvneshwar Kumar (14) and 56 for the eighth with Harbhajan Singh (22).

The skipper finished with four sixes, including one off the final delivery from young paceman Kagiso Rabada, and seven boundaries.

Dhoni then marshalled his limited resources astutely as left-arm spinner Axar Patel and seamer Kumar grabbed three wickets each and Virat Kohli took three good catches to fashion the unexpected win.

Having lost the opening encounter in Kanpur by five runs, India go into Sunday's third international in Rajkot on level terms and looking increasingly confident.

Faf du Plessis was the lone batsman to shine for the tourists with 51 as the rest of the batting succumbed under the pressure applied by Dhoni's men under lights.

The Proteas were sailing along at a comfortable 134-2, following a 82-run stand between du Plessis and JP Duminy, when India bounced back with three wickets in the space of 15 deliveries.

Patel trapped Duminy leg-before for 36 and had du Plessis offering a catch to Kohli in the covers, before Kumar forced David Miller to edge his first delivery to Dhoni behind the stumps.

Kohli then dived to his left in the covers to pick up a superb catch that removed danger man, the South African captain AB de Villiers, for 19 and made South Africa 167-6 in the 33rd over.

Farhaan Behardien (18) and Rabada (19 not out) attempted to pull South Africa out of trouble, but India held their nerves in front of a sell-out crowd of 27,000 home fans.

Earlier, fiery pace spearhead Dale Steyn claimed 3-49 and fellow fast bowler Morne Morkel and leg-spinner Imran Tahir chipped in with two wickets each to restrict the Indian batsmen.

Ajinkya Rahane was the only other batsman besides Dhoni to shine with 51.

India's batting woes at the top of the order were highlighted by the run out of star batsman Kohli for 12 while attempting a second run when Rahane was dropped at mid-off by Behardien.

Both batsmen were stranded at the non-striker's end as bowler Steyn relayed Behardien's throw to wicket-keeper Quinton de Kock, who broke the stumps.

South Africa had won the preceding Twenty20 series 2-0. The one-dayers will be followed by four Test matches.