Jacques Kallis hit his second Test double century and AB de Villiers added a thrilling hundred before South Africa declared on 580 for four on the second day of the third and final Test against Sri Lanka at Newlands on Wednesday.
Sri Lanka were 29 for no wicket at tea as they set out on the massive task of playing themselves back into the match after captain Tillekeratne Dilshan's decision to send South Africa in backfired spectacularly.
Kallis made a career-best 224 and De Villiers hit an unbeaten 160 before the declaration.
Kallis was out in the last over before lunch when he was caught at mid- on off left-arm spinner Rangana Herath after batting for 435 minutes.
He faced 325 balls and hit 31 fours and a six. His fourth wicket partnership with De Villiers was worth 192.
South Africa added 106 runs in 28.3 overs before lunch before the scoring rate rocketed after the interval as De Villiers and Jacques Rudolph (51 not out) piled on another 127 runs off 20.3 overs in 79 minutes.
De Villiers reached his century off 176 balls and then cut loose, adding another 60 off 29 balls. His innings included 19 fours and two sixes - the latter hit off successive balls from Dilshan.
Kallis, resuming on 159, hit boundaries off his first two balls of the day, from Dhammika Prasad. But he had an escape on 171 when Prasad was able to make a ball deviate enough off the pitch for Kallis to edge it low to second slip where a diving Mahela Jayawardene got his fingers to the ball but was unable to hold on.
There was more good fortune for Kallis on 183 when he edged Angelo Mathews between wicketkeeper Dinesh Chandimal and Jayawardene, who was at a wide solitary slip.
Kallis, playing in his 150th Test, reached his double century off 280 balls with 29 fours and a six. His previous double century came against India at Centurion last season when he made 201 not out.
Indicative of the dominance of the batsmen, the Sri Lankan bowlers were able to deliver only two maiden overs, both by the left-armed Chanaka Welegedera early in the day.