South Africa halted a run of four consecutive defeats to Sri Lanka by securing a crushing innings victory in the first Test at Centurion.

From 65-2 overnight going into day four, Sri Lanka could only make 180 all out as they succumbed to defeat by an innings and 45 runs.

Unbeaten on 33 at the start of play, Kusal Perera went on to reach a patient 64, while Wanindu Hasaranga bludgeoned 54 in boundaries in a rapid-fire 59 that came from 53 deliveries.

But Sri Lanka's task on Tuesday looked challenging from the off, particularly given they were without injured all-rounder Dhananjaya de Silva, who retired hurt in the first innings.

After a pair of home wins in 2018, and two more in South Africa in early 2019, the Sri Lankans were eyeing a fifth successive Test victory over their hosts.

Yet the location for this first leg of the two-match series boded well for South Africa, given they had won all four of their previous four Tests against Sri Lanka in Centurion.

When Dinesh Chandimal fell for 25, bowled by Wiaan Mulder having added just four to his overnight score, the prospects of Sri Lanka avoiding defeat looked bleak.

Facing a 225-run first-innings deficit, the tourists' hopes of making South Africa bat again grew more forlorn when Niroshan Dickwella (10) was caught behind off Mulder.

The end of Perera effectively spelled the end of Sri Lankan hopes, with a review showing he snicked a fine delivery from Anrich Nortje through to wicketkeeper and captain Quinton de Kock.

Hasaranga's entertaining cameo containing 12 fours and a six came to an end when one blow too many saw him caught by Temba Bavuma in the deep off Lutho Sipamla, and Kasun Rajitha was dismissed by Nortje for a 27-ball duck to wrap up the game.

The second Test begins in Johannesburg on January 3.