Jacques Kallis completed his second test double century and AB de Villiers scored an unbeaten 160 to put South Africa in control of the third and deciding test against Sri Lanka on Wednesday.
Their combined efforts enabled South Africa, seeking their first series win at home in three seasons, to declare 40 minutes before tea on the second day on 580 for four.
At the close, Sri Lanka were 149 for two after captain Tillakaratne Dilshan had scored a quickfire 78. Sri Lanka's leading batsmen Kumar Sangakkara (35 not out) and Mahela Jayawardene (seven not out) were still at the crease.
Kallis, who resumed on 159, had not exceeded 200 in a despite amassing 10,000 test runs until his 201 not out against India at Centurion in December, 2010. The 36-year-old needed just 65 deliveries on Wednesday to reach his second double century, in 394 minutes and 280 balls, with 29 fours and a six.
He fell on the stroke of lunch when an attempted lofted drive went off the toe of the bat to Angelo Mathews, who took a tumbling catch at deep mid-on to give persevering left-arm spinner Rangana Herath his only wicket.
Kallis enjoyed some good fortune as two outside edges, on 171 and 183, went through the hands of Jayawardene in the slips, off the bowling of Dhammika Prasad and Mathews respectively.
De Villiers helped himself to 160 not out off just 205 balls, with 19 fours and two sixes.
Jacques Rudolph accompanied De Villiers until the declaration, scoring 51 not out as he helped to add an unbeaten 127 for the fifth wicket off just 123 balls. De Villiers' innings took only 205 balls and included 19 fours and two sixes.
When Sri Lanka batted, Dilshan was quickly into his stride. He blasted 12 fours in his run-a-ball innings, before falling to leg-spinner Imran Tahir.
Dilshan lofted a drive into the outfield but the delivery was a googly that took the inside half of the bat, allowing Graeme Smith to run from deep mid-on and take a superb diving catch.
Lahiru Thirimanne had earlier been bowled through the gate, his attempted drive getting nowhere near a Morne Morkel thunderbolt, for 23.