Durban - Faf du Plessis's brilliant 90 has left South Africa firmly in command in the first Test against Sri Lanka at Kingsmead.
Du Plessis was a picture of composure and resilience in an innings that lasted four hours. He fell 10 runs short of what would have been a 10th Test century, but he has done more than enough to give his side the platform to take a 1-0 lead in the two-match series.
The Proteas could not offer any lower order resistance and were eventually bowled out for 259, and Sri Lanka will start their second innings in gloomy conditions needing an unlikely 303 for victory.
At the start of day three on Friday Sri Lanka were still in the contest with the hosts 227/5.
The visitors, desperate for early wickets, immediately went to their premier seamers with Suranga Lakmal and Vishwa Fernando looking for the breakthrough, but Du Plessis and De Kock played intelligently.
Leaving well outside off-stump, both batsmen waited patiently for anything slightly overpitched or wide to keep the scoreboard ticking.
With the fast bowlers looking somewhat toothless, Sri Lanka then went to spin in just the sixth over of the day through Dhananjaya de Silva.
Lakmal kept going without any success, and De Kock clipped the lanky quick through mid-wicket in his seventh over of the day to bring up a 15th Test match half-century.
It was De Kock's second 50 of the match after his crucial 80 in the first-innings, and his value to this Proteas Test side becomes more apparent with every passing series.
De Kock was out for 56, though, when we tried to work left-arm spinner Lasith Embuldeniya (5/66) through the on-side.
The ball spun a lot, which is good news for South Africa and Keshav Maharaj, but De Kock missed it completely and was trapped plumb in front despite immediately sending the decision upstairs for a review.
That brought an end to a 96-run stand between De Kock and Du Plessis that had effectively played the visitors out of the context.
The pair added 65 valuable runs in what proved to be a crucial 80 minutes on Friday, and when Sri Lanka did get the breakthrough the Proteas were 191/5 and 235 runs ahead.
Du Plessis was out padding up to a ball from Fernando that was angled in to the stumps and held its line.
The skipper misjudged the line completely and was given out LBW.
Vernon Philander (18), Keshav Maharaj (4), Kagiso Rabada (0) and Dale Steyn (1) went quickly thanks to Fernando (4/71) and Embuldeniya.
South Africa lost their last five wickets for just eight runs, but their seamers are well rested and are expected to make early inroads as Sri Lanka set about achieving something special.