India came to bat first and put up an outstanding total of 219 for six in their 20 overs, with Varma's powerful hitting and a quick-fire 50 off just 25 balls from opener Abhishek Sharma leading the charge.
South Africa were always behind in their chase in the face of some excellent spin bowling from Axar Patel and the wiles of seamer Arshdeep Singh , but a late flurry of runs got them close.
They managed 208 for seven in reply and trail India 2-1 in the four-match series with the final game to be played in Johannesburg on Friday.
Varma and Sharma put on 107 from 50 balls for the second wicket to lay the platform for the visitors as South Africa lacked discipline with the ball, conceding 10 wides and three no balls in the innings.
Varma reached his century from 51 deliveries as he struck eight fours and seven sixes.
The South African reply was an over old when the players were forced from the field for almost 30 minutes by a swarm of flying ants.
When they returned, India's spinners squeezed the run-rate in the middle overs, though the home side were kept in the contest by Marco Jansen's career-best 54 from 17 balls and Heinrich Klaasen's 41 from 22 deliveries.
This article was generated from an automated news agency feed without modifications to text. Stay informed with the...