AB de Villiers and Rohit Sharma both struck centuries as South Africa beat India by five runs in the first one-day international thanks to some excellent final-over bowling from Kagiso Rabada.
Having won the Twenty20 series 2-0, South Africa set India 304 for victory thanks to an unbeaten 104 from De Villiers, who hit five boundaries and six maximums in a typically entertaining innings.
Rohit bettered De Villiers by scoring 150, with his innings brought to an end when he was caught and bowled by Imran Tahir (2-57) in the 47th over.
After Rohit's exit, India needed 11 off the last over to clinch victory at Green Park in Kanpur, but Rabada (2-58) removed MS Dhoni (31) and Stuart Binny (2) in consecutive deliveries to seal the win for the Proteas as the hosts finished on 298-7.
South Africa made a solid start and had only lost two wickets by the midway point of their innings.
Quinton de Kock (29) was first to fall - caught by Suresh Raina off the bowling of Ravichandran Ashwin (1-14).
Ashwin later picked up a side strain and will be replaced in the squad by Harbhajan Singh for the second clash of the five-match series.
Hashim Amla's exit for 37 brought De Villiers to the crease and he wasted little time in bringing up 104 off 73 deliveries.
Faf du Plessis contributed 62 runs to the cause as South Africa set India a challenging target, but the hosts' innings looked set to follow a similar pattern to that of their opponents.
Rohit led from the front - hitting 13 fours and six sixes on his way to 150 - and was ably supported by Ajinkya Rahane (60), with the pair putting on 149 runs for the second wicket.
But Tahir took out Rohit and Suresh Raina (3) in the 47th over as the hosts went from needing 35 off 24 balls to requiring 31 from 18.
That put India on the ropes and Rabada delivered the knockout blows in the last over, with the next instalment of the series to take place at Indore on Wednesday.