Sri Lanka 157 and 150 for 4 (Karunaratne 91*) lead South Africa 302 (Elgar 127, van der Dussen 67, V Fernando 5-101) by five runs
South Africa still control the second Test, but after an abject first day, Sri Lanka resisted on day two, raising mild hope. First, the seamers lay siege, rolling through South Africa either side of lunch, to claim nine wickets for 84 runs - Vishwa Fernando taking five of those. Later, captain Dimuth Karunaratne produced his best innings in South Africa, to be not out on 91 by stumps.
And yet, thanks in part to centurion Dean Elgar, and the 184-run stand he put on with Rassie van der Dussen, Sri Lanka lead by only five runs, with six wickets in hand. To set a target that might test South Africa, they perhaps need 195 more. Karunaratne is the only batsman who appeared comfortable against the home attack's pace and bounce - this surface having got quicker on day two and expected to get quicker still on Tuesday. Niroshan Dickwella, his overnight partner, practically hung on pale-knuckled for his 18 off 47, after Sri Lanka lost three wickets for 23 in the evening session.
It had been Vishwa, however, whose left-arm angle, and ability to seam it both ways, brought Sri Lanka - even limpingly - back into the contest. Before lunch, he had Quinton de Kock driving at an away-seamer just ouside off, and sending a thick edge to Kusal Mendis at second slip, who dove to his right to nab it.
After the break, Vishwa was a menace. He swung one in to Wiaan Mulder second ball of the session, to trap him in front of leg stump. That was a marginal call, but the next lbw, several overs later, was emphatic. He jagged one in sharply at Temba Bavuma from around the wicket, and had the batsman shouldering arms to a ball that would have clattered into the stumps. Later, he had Anrich Nortje nicking off, and then had Lutho Sipamla caught at gully to restrict South Africa to a lead of only 145, when something in the region of 250 or more had seemed likelier.
That wicket of Sipamla completed the first five-wicket haul of his career, beating the 4 for 62 he managed in Durban in 2019. Already, Vishwa is Sri Lanka's most successful seamer in South Africa - his 20 wickets in four Tests bettering Dilhara Fernando's 18 in seven matches. Asitha Fernando and Dasun Shanaka took two wickets apiece as well, while Dushmantha Chameera sparked the collapse, by having Elgar caught behind on 127.
After Sri Lanka's seamers rampaged, Lungi Ngidi bowled Kusal Perera early, with a sublime, seaming full delivery in the third over. Karunaratne, though, set about establishing himself at the crease. Though clearly nervy against the new ball, edging the first of his 17 fours through the gap between slips and gully, he gritted his way through the early overs, until he found his timing, particularly off his pads. Nortje was at times touching 93mph/150kph, but Karunaratne dispatched him for successive leg-side fours in his seventh over, and spared no-one that drifted into his pads.
While Lahiru Thirimanne stroked a pretty 31 at the other end, joining him for an 85-run stand, Karunaratne worked himself up to an impressive strike rate. His half-century - just his second in 14 innings in South Africa - he reached with a four down the ground off the 73rd delivery he faced. Soon after, Ngidi had two batsmen - Thirimanne and Kusal Mendis - caught edging down the leg side, and Nortje bounced out debutant Minod Bhanuka. But Karunaratne batted as if unperturbed - his strike rate remained up at 78 by stumps.
Elgar had also maintained an excellent scoring rate, as he moved from his overnight 92 to an eventual 127 off 163 balls. His partner, van der Dussen, had begun the day more streakily, edging a Vishwa ball in the early overs, only for Mendis to fail to hold on to the tough chance diving to his right from second slip. Eventually, van der Dussen settled, and drove nicely, on occasion, to complete a half century before being dismissed for 68.
Elgar was much more assured. Having been dismissed for 95 at Centurion, he was almost faultless through the 90s on this occasion, and completed his century in the fifth over of the day, thrashing a short, wide ball through point for four, in a morning in which he had punished bowlers the moment they erred in length.
It was his 13th Test ton, and in there had barely barely a false stroke from Elgar until his dismissal to second ball after drinks. Seeing a straight, length ball just outside off stump from Dushmantha Chameera, he prodded at it with hard hands and sent an edge to the slips.
Andrew Fidel Fernando is ESPNcricinfo's Sri Lanka correspondent. @afidelf