Rohit Sharma's century has helped India win a one-day series in South Africa for the first time as they secured a 73-run victory in Port Elizabeth.
India took an unassailable 4-1 lead in the six-match series as Sharma finally came good with the bat, scoring 115 after India were asked to bat first and amassed 274 for seven wickets in their 50 overs.
South Africa, who needed victory to keep alive their hopes of levelling the series, were all out for 201 in 42.2 overs in the chase, with Yadav taking 4-57 and Chahal 2-43.
It means India replace South Africa at the top of the International Cricket Council's ODI rankings.
India's series victory came after they lost 2-1 in the three Tests played between the two countries last month.
Sharma had struggled with his batting on tour but got India off to a storming start as he finally found form.
He was dropped on 96 by Tabraiz Shamsi before going onto make his 17th ODI century, reached off just 107 balls.
"It was a long time coming. I just had to keep myself in a good frame of mind. I didn't feel I had to change a lot and I knew that the runs would come," he said after being named man of the match.
But his dismissal, for India's fourth wicket, precipitated a mini collapse as 21-year-old fast bowler Lungisani Ngidi took four wickets in quick succession to finish with figures of 51-4.
India's last 10 overs produced only 55 runs and handed South Africa a gettable target at a run rate of 5.50.
But the hosts were 65-3 when AB de Villiers went cheaply after a rash shot in the 13th over and once Hashim Amla departed for 71 after a needless run out, home hopes were dashed.
A cameo 39 from wicketkeeper Heinrich Klaasen, who had been the hero of South Africa's victory in the last match, could not stem the inevitable as Kuldeep Yadav cleaned up the tail.
"We lost wickets in clumps and never got any momentum although it was a decent tally to chase," South Africa's stand-in captain Aiden Markram said.
The last match of the series is at Centurion in Pretoria on Friday and will be followed by three Twenty20 clashes.
Qantas tour of South Africa
Australia squad: Steve Smith (c), David Warner (vc), Cameron Bancroft, Pat Cummins, Peter Handscomb, Josh Hazlewood, Jon Holland, Usman Khawaja, Nathan Lyon, Mitchell Marsh, Shaun Marsh, Tim Paine, Jhye Richardson, Chadd Sayers, Mitchell Starc.
Warm-up match v SA Invitational XI, Sahara Park, Benoni, Feb 22-24
First Test Kingsmead, Durban, March 1-5
Second Test St George's Park, Port Elizabeth, March 9-13
Third Test Newlands, Cape Town, March 22-26
Fourth Test Wanderers, Johannesburg, March 30-April 3