Jacques Kallis marked his 150th Test by joining the elite band of players to have made centuries against every Test-playing nation as South Africa took control against Sri Lanka.
The Proteas were put in to bat in the series-deciding third Test in Cape Town but a stand of 205 between Kallis and the recalled Alviro Petersen led them to 347 for three by the close.
Touring captain Tillakaratne Dilshan would have been frustrated by his bowlers' unthreatening display on a batsman-friendly surface, and they will have to show a vast improvement tomorrow to prevent South Africa building an impenetrable lead.
Home captain Graeme Smith set the tone early on with three boundaries but Dhammika Prasad bowled him and then trapped Hashim Amla lbw, both for 16, to leave South Africa in slight trouble on 56 for two.
But Petersen struck six fours and a six in reaching his fourth Test half-century before lunch and Kallis reached his 56th Test fifty from 42 balls early in the afternoon session.
The century partnership came up in just 113 balls and the pair soon passed their country's third-wicket record against Sri Lanka of 140 - previously held by Kallis and Herschelle Gibbs.
Anything on leg stump was punished particularly severely as both men closed on three figures and Kallis, who had gone beyond 70 at quicker than a run a ball, reached a 114-ball century by clipping Prasad through mid-wicket for two. He had hit 17 boundaries.
Petersen had been fortunate not to be run out in the previous over, when he was sent back after rashly setting off for a single which would have taken his partner to his hundred, and also narrowly missed a loose slash at Angelo Mathews off the last ball before tea as he remained 99 not out.
Kallis was almost run out immediately after tea but then hoisted Herath for six before Petersen finally reached his hundred with a single off Rangana Herath, from 165 balls with 12 fours and a six.
The partnership reached 200 when Petersen drove Prasad inches past the bowler's end stumps for a superb boundary - but the opener fell soon after when a loose shot outside off stump was well caught by a diving Tillakaratne Dilshan at extra cover.
New man AB de Villiers made a slow start as Sri Lanka belatedly began to slow the run rate, but he moved into double figures with a delicious straight drive for four.
Dilshan's first ball was smashed for four by Kallis, who then survived an lbw appeal from Herath with the ball missing leg stump.
The fourth-wicket partnership took a relatively pedestrian 122 balls to pass 50 and Kallis soon reached 150, from 201 balls with 21 fours and a six.
De Villiers reached 45no by the close but the day belonged to Kallis, who will resume on 159 when play begins tomorrow. Prasad's two for 85 was the pick of the bowling figures.