Theunis de Bruyn scored a defiant maiden Test century but Rangana Herath spun Sri Lanka to a 199-run victory in Colombo to whitewash South Africa on day four.
Sri Lanka needed just five wickets to complete a convincing 2-0 series win on Monday, but De Bruyn and Temba Bavuma showed some much-needed resistance to keep the hosts waiting.
De Bruyn (101) played with patience in a superb 232-ball innings, putting on 123 for the sixth wicket with Bavuma (63) under pressure from the potent Sri Lanka spinners.
Herath came to the fore yet again, though, striking twice just before lunch and finishing with figures of 6-98 - his 34rd five-wicket Test haul - to eventually dismiss the tourists for 290.
Suranga Lakmal, who bowled only two overs in the match, has now won all three Tests since stepping in to replace suspended captain Dinesh Chandimal.
It's a wrap! Sri Lanka beat South Africa by massive 199 runs and seal the 2-match series 2-0!— Sri Lanka Cricket (@OfficialSLC) July 23, 2018
SA 124 & 290 (86.5 Ovs, Herath 6/98) v SL 338, 275/5dhttps://t.co/ne7t5sHYOe #SLvSA #LionsRoar #OneTeamOneNation pic.twitter.com/pwwiiIBiKk
De Bruyn, promoted to number three in his sixth Test, was solid in defence and took every opportunity to attack after South Africa resumed on 139-5, reaching his 50 by punching Dilruwan Perera to the cover boundary.
Bavuma took a more positive approach, sweeping with assurance and striking Akila Dananjaya to the ropes twice in an expensive over.
The diminutive right-hander made it through to his half-century when he swept Herath for a single, but the slow bowler had him caught behind to end a long partnership, then removed Quinton de Kock just before the interval.
De Bruyn continued to tick along with support from Kagiso Rabada, who danced down the track to launch Herath for a huge straight six.
The excellent De Bruyn reached three figures by glancing Herath to the fine-leg boundary but was on his way four balls later, bowled offering no shot to gift the left-armer a fifth wicket in the innings.
Dilruwan (2-90) saw the back of Rabada for 18 and Danushka Gunathilaka took a high catch to consign South Africa to defeat as Dale Steyn failed in his attempt to hit Herath for a second six.
|Osaka can be one of the greats, says coach Sascha Bajin|
|Liverpool´s Naby Keita carried off injured in Guinea match|
|Duminy to miss Australia tour for shoulder surgery|
|F1 Raceweek: Ferrari ready to ´challenge the impossible´ as Hamilton nears title|
|Umesh replaces injured Thakur in ODI squad|
|IAAF delay implementation of testosterone ruling amid Semenya challenge|
|Fakhar and Sarfraz lead Pakistan recovery after Lyon blitz|
|Japan see off Uruguay in seven-goal thriller|
|Arda Turan given huge fine by Istanbul Basaksehir after alleged brawl with singer|
|Busquets no better or worse than Dier – does Opta data back up Allardyce claim?|
|United boss Mourinho charged for alleged post-match comments by FA|
|Halep withdraws from Kremlin Cup ahead of WTA Finals|
|Renato Sanches eager for further Bayern Munich minutes|
|Nations League standings: Promotion, relegation and race for finals|
|Windies coach Law banned for ´inappropriate comments´ in India Test|
|Carrick denies Manchester United stars are ´not trying´|
|Ferrari struggling under pressure of chasing Mercedes, says Massa|
|Australia desperately need Smith and Warner back - Warne|
|Draxler warns Germany: Mbappe has 300 hp!|
|Draymond Green says Warriors will have to ´bring it´ every night in the West|
|England´s ´wonderful bravery´ leaves Southgate excited for the future|
|Jayasuriya: I always conduct myself with integrity and transparency|
|Northern Ireland stars hurt by lack of club football, says O´Neill|
|Rodgers inspires late Packers comeback|
|Brewers blank Dodgers to take 2-1 NLCS lead|
|Cavaliers, Nance agree to four-year extension|
|Ramos wants Spain to believe in Luis Enrique´s team|
|De Laurentiis: I´ve spoken to Genoa and agent about Piatek|
|Kaka tips bright future for Paqueta after Milan agreement|
|Suns star Booker set to return for season opener|
|Warriors coach Kerr not expecting fast start from NBA champs|
|Fultz to start for 76ers as Brown eyes NBA Finals|
|Maltese champions Valletta want Usain Bolt|
|It would have been normal to kill them! Luis Enrique slams abysmal Spain|
|Seahawks, Trail Blazers owner Paul Allen dies aged 65|
|Red Sox ace Sale released from hospital, still set for game five|
|Beer-throwing fan banned by Patriots|
|Southgate lauds ´tremendous´ attackers after famous Spain win|
|Djokovic closing in on summit as he scales new heights|
|Monaco the natural move for Henry - Martinez|
|Ending England drought a ´beautiful feeling´ – Sterling|
|Halep to face Pavlyuchenkova in Moscow comeback|
|NBA 2018-19: Five non-LeBron James storylines to follow|
|Spain 2 England 3: Kane inspires Three Lions as Sterling ends drought in style|
|Bosnia-Herzegovina 2 Northern Ireland 0: Dzeko double leaves O´Neill´s side on the brink|
|Mannarino stops the rot in Moscow|
|Neymar pleased Brazil will not face Messi in Argentina clash|
|Buccaneers fire defensive coordinator Mike Smith after loss to Falcons|
|´Surprised´ Deschamps accepts he could´ve made more effort with Koscielny|
|Kuwait 0 Australia 4: Socceroos deliver win for new coach Arnold|
|Van Dijk fit for Liverpool return - Koeman|
|NBA 2018-19: Eastern Conference predictions|
|NBA 2018-19: Five rookies to watch|
|Denly replaces injured Dawson in England ODI squad|
|Low confirms under-fire Neuer to start against France|
|NBA 2018-19: Western Conference predictions|
|Bolt offered two-year deal by European club, says agent|
|NBA 2018-19: LeBron the Laker - what it means|
|Griezmann ahead of Mbappe for Ballon d´Or - Modric|
|Billy Vunipola ruled out with fractured arm|
|Get the chequebook out! - Mayweather talks up potential Khabib clash|
|Amla ruled out of Australia tour|
|Class act Hamilton more complete than ever - Wolff|
|NBA 2018-19: It´s a big season for - Ball, Kawhi, Carmelo, Love & Cousins|
|Bellew: I have no fear of Usyk|
|Birthday boy Ozil is the most creative player in Europe|
|CSA reveals De Villiers and Rabada involved in Mzansi Super League|
|FA condemns England supporters involved in trouble in Seville|
|Gascoigne hits back over Scottish Hall of Fame snub|
|NBA 2018-19: LeBron closing in on Jordan, Curry chasing Miller and Allen|