The Proteas require only 43 more runs to secure victory over Sri Lanka at the Wanderers and wrap up the Test series.
Having dismissed the visitors for only 221 early on Tuesday morning, the Proteas were set a small target of 67 to win.
Sri Lanka got the day going on 150-4 and with a five-run lead, Dimuth Karunaratne (91) and Niroshan Dickwella (18) looking solid at the crease.
It didn’t take long for the Sri Lanka captain to bring up his 10th Test century with a beautiful cut shot to the boundary.
The pair made a strong start with the bat, but Anrich Nortje sparked a collapse when he removed Karunaratne for 103.
Lungi Ngidi then accounted for the important wicket of Dickwella for 36, who played a loose shot straight to Temba Bavuma.
Dasun Shanaka was the next batsman to depart, lofting a poor attempt straight to Lutho Sipamla at mid-on off a Wiaan Mulder delivery.
As he did in the first Test in Centurion, Sipamla cleaned up the Sri Lankan tail with three quick wickets – Wanindu Hasaranga, Dushmantha Chameera and Asitha Fernando all sent packing.
Openers Dean Elgar (8) and Aiden Markram (16) made it safely to lunch, with the Proteas on 24-0 and closing in on a comfortable victory.
Proteas: Aiden Markram, Dean Elgar, Rassie van der Dussen, Faf du Plessis, Quinton de Kock (c; wk), Temba Bavuma, Wiaan Mulder, Keshav Maharaj, Anrich Nortje, Lungi Ngidi, Lutho Sipamla.
Sri Lanka: Dimuth Karunaratne (c) KJ Perera, Lahiru Thirimanne, Kusal Mendis, Minod Bhanuka, Niroshan Dickwella (wk), Dasun Shanaka, Wanindu Hasaranga, Vishwa Fernando, Dushmantha Chameera, Asitha Fernando.