Sri Lanka were 149 for two and trailing by 431 runs at the close of play on day two of the third and final cricket test against South Africa in Newlands, after the hosts declared on 580 for 4 in their first innings.
The Proteas batsman Jaques Kallis made a career-best 224 and AB De Villiers hit an unbeaten 160 before the declaration.
The 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.
The three test series was locked up at 1-all heading into the final match.