Lunch South Africa 302 and 24 for 0 (Markram 16*, Elgar 8*) need a further 43 to beat Sri Lanka 157 and 211 (Karunaratne 103, Ngidi 4-44)
Any momentum Sri Lanka had gained on day two, they squandered within the first 90 minutes of day three, losing their last six wickets for 35 runs as South Africa's quicks hunted relentlessly. There was the brief joy of Dimuth Karunaratne getting to his first hundred in South Africa, but this soon gave away to despair. Anrich Nortje, Lungi Ngidi and Lutho Sipamla ensured that their side would only need 67 for victory, was which was reduced to 43 by lunch.
Having begun the day five runs ahead, there was mild hope that Sri Lanka would set a decent target, particularly with Karunaratne appearing assured in the early overs. He started on 91, and struck consecutive fours in the third over of the day to raise his first century outside Sri Lanka since 2017, and his tenth overall.
He had been occasionally troubled by the bounce Anrich Nortje was generating at a rapid pace, however, and it was this extra bounce that brought his downfall. Nortje pitched one just back of a length, and angled it into Karunaratne from around the wicket. The batsman attempted to swat it to the leg side, but ended up only offering a catch to square leg off the top edge.
Niroshan Dickwella had been far less secure during his innings and was himself out the next over, a ball from Lungi Ngidi ballooning off his leading edge to cover as he attempted to work it to leg. He was out for 36, and the remaining wickets didn't take long. Dasun Shanaka spooned Wiaan Mulder to mid-on. Wanindu Hasaranga played a startlingly awful heave against Lutho Sipamla and was bowled. Then in his next over, Sipamla claimed the two remaining wickets in the space of three balls.
Ngidi finished with 4 for 44, having also been excellent in the third session on day two. Sipamla picked up three, continuing a habit of wiping out the lower order in this series.
In the five overs they faced before lunch, Dean Elgar and Aiden Markram set South Africa confidently on track to their target. Markram, who had the majority of the strike, did have one scare, when he edged Vishwa Fernando low towards the slip cordon in the over before lunch. Kusal Mendis had dived across to make what initially seemed like a good catch, only for replays to show that he may have grounded the ball briefly. The third umpire ultimately ruled this not out.
Andrew Fidel Fernando is ESPNcricinfo's Sri Lanka correspondent. @afidelf