Sri Lanka lost two wickets after taking a pounding from South African batsmen Jacques Kallis and AB de Villiers on the second day of the third and final Test at Newlands on Wednesday.
Sri Lanka were 149 for two at the close in reply to South Africa's 580 for four declared, a deficit of 431 runs.
Kallis made a career-best 224 and De Villiers hit an unbeaten 160 before the declaration.
Sri Lankan captain Tillekeratne Dilshan hit a dashing 78 before he was caught at deep mid-on off leg-spinner Imran Tahir. Fellow opener Lahiru Thirimanne was earlier bowled by Morne Morkel for 23 as Sri Lanka set out on the massive task of playing themselves back into the match after Dilshan's decision to send South Africa in backfired spectacularly.
South Africa scored at better than four runs an over and were able to declare in mid-afternoon in an attempt to push for a series-clinching victory.
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.