South Africa will take a lead of 161 runs into the second innings of the first test against England at Lord's.
The Proteas resumed on 289-7 and were bowled out for 326 after an hour's play on Day 3, with Stuart Broad taking a wonder-catch before cleaning up the tail with two wickets on Friday.
Broad leaped backward and took a one-handed catch at wide mid-on to remove Kagiso Rabada for 3 off the third ball of the day, bowled by Matt Potts, then got edges into the slip cordon to account for Marco Jansen (48) and Lungi Ngidi (0).
Anrich Nortje was stranded on 28 not out.
England, which was bowled out for 165 early on the second day, has won four straight test matches under the new leadership team of captain Ben Stokes and coach Brendon McCullum.