Set 41 to win, South Africa reached 43 for the loss of one wicket from 9.5 overs.
The result ensured a seventh successive home series win for South Africa, who won the first Test in Centurion by six wickets. The third and final Test starts in Johannesburg on Friday.
Regular South African opening batsman Aiden Markram did not bat after suffering a severely bruised right thigh when he fell heavily on the boundary rope while fielding on Saturday.
Theunis de Bruyn, opening in place of Markram, clipped Mohammad Abbas to the midwicket boundary but did not add to his score before being caught off his glove by wicketkeeper and captain Sarfraz Ahmed while attempting to pull a bouncer from Abbas.
Dean Elgar, who made 24 not out, ended the match by hitting two fours off part-time bowler Azhar Ali.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)