Keshav Maharaj produced his career-best figures as he curtailed Sri Lanka's early momentum on day one of the second Test in Colombo with a magnificent eight-wicket display.
The touring Proteas suffered a 278-run defeat in the first Test of the two-match series and appeared set for a trying day in the field on Friday as Sri Lanka delivered their first century opening stand since October 2016.
But Maharaj dislodged openers Danushka Gunathilaka (57) and Dimuth Karunaratne (53) and then proceeded to rip through Sri Lanka's middle-order in posting figures of 8-116.
His stunning show restricted Sri Lanka to 277-9, with Dhananjaya de Silva (60) the only other home batsman to make a meaningful contribution.
After being skittled for 126 and 73 in the first Test, South Africa will now look to take the final wicket quickly on Saturday and back up Maharaj's efforts with a batting performance that puts them in a position to draw the series.
The Maharaj show! South Africa's spinner takes a brilliant 8/116, his best ever Test figures, with Sri Lanka reduced to 277/9 on the opening day of the second Test in Colombo.#SLvSA scorecard https://t.co/P4Eg7K1Nw9 pic.twitter.com/wJb4CqPLZk— ICC (@ICC) July 20, 2018
Sri Lanka's decision to bat first appeared to be vindicated as Gunathilaka and Karunaratne put on 116 runs inside 35 overs.
But Karunaratne was removed when he was strangled down the leg side by Maharaj to be caught by wicketkeeper Quinton de Kock. Two overs later, and with just one run added, Gunathilaka top-edged Maharaj to Kagiso Rabada, who tore forward from deep square leg to take a terrific catch.
De Silva shared stands of 36 with Kusal Mendis (21) and 54 with Roshen Silva (22) but he otherwise found little in the way of partners as the middle order failed to cope with Maharaj's accurate and aggressive approach.
Rabada, the day's other wicket-taker, dismissed Silva with a yorker before Niroshan Dickwella edged Maharaj to first slip, giving the left-armer his fifth five-wicket haul in the longest format.
De Silva's resistance was ended by a successful Sri Lanka review after Maharaj trapped him lbw and, with Akila Dananjaya and Rangana Herath the last men at the crease for the hosts, Sri Lanka will at least take solace in that there should be plenty for their own spinners to exploit.
|Salah can play much better - Klopp demands more from Liverpool star|
|Gasly to Red Bull: Vettel, Verstappen and the drivers who took their Toro Rosso chance|
|Klopp in the dark on Karius future amid links to Besiktas|
|Simeone pleased with draw after rigours of Super Cup|
|Captain Reus saves Dortmund in DFB-Pokal|
|I couldn´t care less - Klopp rejects title challenge talk|
|Ailing Bairstow keen to aid England´s unlikely victory bid at Trent Bridge|
|Redskins secure Peterson signing|
|Manchester City goalkeeper Bravo suffers ruptured Achilles|
|Crystal Palace 0 Liverpool 2: Milner and Mane secure victory at Selhurst Park|
|Whyte takes aim at ´coward´ Fury ahead of Wilder showdown|
|Jets delighted with Darnold, open to trading Bridgewater|
|Gasly to replace Ricciardo at Red Bull|
|Valencia 1 Atletico Madrid 1: Rodrigo strikes to deny Simeone´s side|
|Injured Halep withdraws from Connecticut Open|
|Cipriani fined £2,000 by Gloucester|
|Mourinho will be sacked before Christmas, says Sharpe|
|England face record chase after Kohli smashes India to huge lead|
|Ozil captaining Arsenal a miracle - Hoeness|
|Japan players apologise for ´thoughtless, careless´ actions at Asian Games|
|Henry wants Bordeaux job, Wenger confirms|
|Pogba too inconsistent and not a leader, claims Scholes|
|PCB chairman Sethi resigns in letter to Pakistan prime minister Imran Khan|
|US Open comes too soon for Tsonga|
|Unpredictable results making 2018 F1 season a classic - Wolff|
|Mendy restricts phone use on Guardiola advice|
|Modric brands Inter approach claim ´the greatest nonsense in history´|
|Runners and Ryders: Olesen leapfrogs Poulter into last Team Europe berth|
|Kenedy escapes further action over Camarasa kick|
|England´s Bairstow suffers ´small fracture´ to finger|
|Gonalons joins Sevilla on loan from Roma|
|Modric, Ronaldo and Salah final UEFA Player of the Year nominees|
|Tottenham to play opening Champions League home match at Wembley|
|Karius´ Champions League blunders did not lead to Alisson signing - Klopp|
|Leeds considered €20m Conte offer before turning to Bielsa|
|Modric, Rakitic lead new era for World Cup finalists Croatia|
|Storm´s Chambers banned for three weeks, Smith injury not serious|
|Porte to race Vuelta after recovering from Tour crash|
|The Career Golden Masters: A run-down of Djokovic´s magnificent record|
|Japan send home four basketball players from Asian Games amid prostitution scandal|
|Rugby tackle bags helping Liverpool´s Alisson with Premier League life|
|Federer raring to go at US Open after Djokovic defeat|
|Chelsea boss Sarri plans to give up smoking|
|Alonso´s Toyota team stripped of Silverstone victory|
|Ceballos: No issue with former Real Madrid boss Zidane|
|MLS Review: Martinez equals single-season goalscoring record|
|Astros avoid sweep with win over Athletics|
|Seppi advances, Paire exits Winston-Salem|
|Bale feeling good as Madrid eye sweep of trophies|
|You can´t leave a house three-quarters built – Neville urges United to back Mourinho|
|Dodgers slugger Machado leaves game after being struck by pitch|
|Harden says Carmelo will ´be a good fit´ for Rockets|
|Morata: I never considered Chelsea exit|
|Gavrilova kicks off title defence in New Haven|
|Lopetegui pleased with Bale and Real Madrid after LaLiga opener|
|It´s a very special moment – Djokovic revels in Golden Masters achievement|
|Sorrentino thanks Ronaldo for support after injury|
|Twins place Santana on DL with finger injury|
|Yankees´ Gregorius suffers ´pretty significant´ heel bruise|
|Snedeker ends PGA Tour drought with Wyndham Championship win|
|Spalletti unconcerned despite Inter´s underwhelming start|
|Djokovic makes history with Masters clean sweep in Cincinnati|
|Real Madrid 2 Getafe 0: Bale gives Lopetegui first LaLiga win|
|IndyCar driver Wickens taken to hospital after crash|
|Sherman calls for NFL to scrap ´idiotic´ helmet rule|
|Sassuolo 1 Inter 0: New-look Nerazzurri given early reality check|
|Hughton: Shock United win does not alter scale of Brighton´s task|
|Navas keeps place as Courtois waits on Madrid debut|
|Ndidi signs long-term Leicester City contract|
|Pandya tears through feeble England to put India in command|