Kumar Sangakkara struck his first Test century in South Africa to put Sri Lanka in total control of the second Test on day three at Kingsmead.
The Sri Lanka veteran made the most of a reprieve when Graeme Smith dropped him in the first over of the day to compile an elegant 108 which helped the tourists reach stumps on 256-7 - a lead of 426.
The three-figure score was Sangakkara's 28th in Test cricket and South Africa now face an uphill battle if they are to preserve their 1-0 series lead.
Sri Lanka resumed on 7-1 following a rain delay and very nearly lost Sangakkara immediately as Morne Morkel's ball shaped away from off stump, drew the edge but did not go to hand in the slips as Smith was distracted by the late effort from wicketkeeper Mark Boucher.
Morkel did get the reward his probing opening spell deserved when he got a ball to bounce sharply and Tharanga Paranavitana (9) could only edge to a diving Ashwell Prince at fourth slip.
Mahela Jaywardene joined Sangakkara in the middle and the pair swiftly took Sri Lanka's lead past 200.
However, Jayawardene departed for just 14 when he padded up to a Marchant De Lange delivery. Sri Lanka reviewed the decision, but the ball was clearly bound for the top of the stumps and the tourists were now 44-3.
First-innings centurion Thilan Samaraweera provided Sangakkara with solid support, though, and the pair dampened South African spirits with a 94-run partnership for the fourth wicket.
Sangakkara brought up his 50 off 102 balls with an angled drive down to third man off Morkel, which was going for four until Imran Tahir slid in to save two runs.
South Africa finally made another breakthrough when Tahir dismissed Samaraweera for 43, bamboozling the right-hander with a googly which crashed into off-stump via bat and pad.
Angelo Mathews made just three before he swiped at a Dale Steyn (3-54) bouncer and Boucher took a comfortable catch to give South Africa brief hope at 141-5, but Sangakkara remained a thorn in the Proteas' side.
Boundaries number 12 and 13 off successive Jacques Kallis deliveries took him to 99 and he swiftly brought up his century off 161 balls with an eye-catching square drive for two more.
He and Dinesh Chandimal (54) effectively took the game away from South Africa in the final session and the latter registered his second half-century of the match before falling to Steyn caught behind the wicket.
Sangakkara followed him back to the pavilion two balls later when he mis-hit Tahir (2-64) to Smith at mid-on, however the South Africa captain will have taken scant consolation from a dismissal which could, and should, have come much earlier.