Kumar Sangakkara hit a superbly-crafted century to put Sri Lanka in a strong position to press for their first Test win of the year on the third day of the second Test match against South Africa at Kingsmead on Wednesday.
Sangakkara's 108 enabled Sri Lanka to reach 256 for seven in their second innings - an overall lead of 426, eight runs more than the highest successful run chase in Test history.
The left-handed former captain shared stands of 94 with Thilan Samaraweera and 104 with rookie wicketkeeper Dinesh Chandimal as Sri Lanka went in search of their first win in four Test tours of South Africa.
Sangakkara, whose first three innings in the series were 1, 2 and 0, had not added to his overnight score of three when he edged the fourth ball of the morning, from Morne Morkel, towards Graeme Smith at first slip. Wicketkeeper Mark Boucher dived for the ball, obscuring Smith's vision, and the South African captain put down the chance.
Sangakkara made the home side pay as he constructed a classy innings in overcast and gloomy conditions. Overnight and morning rain delayed the start by an hour and the floodlights were on during most of the day.
Sangakkara reached his fifty off 102 balls with four fours and then took command, scoring his second fifty off only 59 deliveries, adding nine more boundaries. It was his 28th Test century.
First innings century-maker Samaraweera shared a crucial fourth wicket stand with Sangakkara after the first three wickets had fallen for 44 runs to give South Africa hope of bowling themselves back into contention despite trailing by 170 runs on the first innings.
Samaraweera made 43 before being deceived by a googly from Imran Tahir which he edged onto his stumps.
Sri Lanka pressed home their advantage as Sangakkara and new cap Chandimal scored at almost a run a minute. Chandimal followed up his first innings 58 with 54.
With the light fading, Chandimal was caught behind off Dale Steyn.
Sangakkara followed in the next over when he hit Tahir to long-on. Bad light stopped play soon afterwards.
Fast bowling debutant Marchant de Lange, who took seven for 81 in the first innings, claimed the key wicket of Mahela Jayawardene as Sri Lanka struggled early in the day.
Jayawardene had scored 14 when he padded up to De Lange and was given out leg before wicket by umpire Steve Davis. Jayawardene sought a television review but the umpire's decision was upheld when replays showed the ball would have hit his off-stump bail.
But De Lange failed to make an impact in later spells as Sangakkara swung the match ever more in his team's favour on a pitch which remained a good batting surface.
South Africa lead the three-match series after winning the first Test at Centurion by an innings and 81 runs.
The hosts can take heart from having chased down 414 against Australia in Perth three seasons ago, only four runs less than the world record 418 for seven by the West Indies against Australia in Antigua in 2002/03.