South Africa hammered Sri Lanka by 10 wickets despite Dimuth Karunaratne's battling hundred to seal a 2-0 series win inside three days in Johannesburg.

Karunaratne was unbeaten on 91 at the close of day two of the second Test with Sri Lanka beginning Tuesday's play at 150-4, but any momentum quickly subsided in a sorry collapse.

The tourists added just 61 more runs and lost their final six wickets for the return of a measly 35, setting the Proteas a meagre target of 67, as Anrich Nortje (2-64), Lungi Ngidi (4-44) and Lutho Sipam (3-40) produced devastating spells with the ball.

Dean Elgar (31) and Aiden Markram (36) steered South Africa over the line with ease in just 13 overs either side of the lunch break to complete a convincing victory.

Karunaratne (103) hit successive fours in the third over of the day as he aimed to help Sri Lanka to a competitive total.

But, having already threatened a couple of times, Nortje (2-64) eventually got the Sri Lanka skipper, his wicked delivery edged into the hands of Wiaan Mulder.

Karunaratne's overnight partner Niroshan Dickwella (36) soon followed, falling to the impressive Ngidi, and the remaining wickets tumbled quickly after that.

Mulder (1-52) dismissed Dasun Shanaka (8), while Sipamla swept up the lower order by taking out Wanindu Hasaranga (16), Dushmantha Chameera (0) and Asitha Fernando (0).

Markram and Elgar, whose first-innings 127 was the highest score of the Test, returned to the crease in a professional mood and hit nine boundaries between them.

The former did have a brief scare when Kusal Mendis appeared to catch him low before the boundary, but the third umpire ruled it not out after replays suggested he grounded the ball, and from there it was plain sailing for the hosts.