Sri Lanka lead by 426 runs with three wickets remaining and two days still to go.
Sangakkara's maiden century in South Africa could also be a match-winner
Sangakkara's 28th Test ton and first in South Africa propelled Sri Lanka to 256 for seven in their second innings and a lead of 426 with three wickets in hand and two days to play at Kingsmead.
The stylish left-hander survived a dropped catch in the first over of the day when he was on three and cashed in with a stroke-filled return to form in his first big score this series.
His century, sharing partnerships of 94 with Thilan Samaraweera (43) and 104 with debutant Dinesh Chandimal (54), helped ensure South Africa would have to make a world-record winning score in the fourth innings to steal the match - or bat for long periods just to draw it.
Having posted 338 in their first innings, and skittled out South Africa for 168, Sri Lanka were in a dominant position to level the three-match series and send it to a decider in Cape Town.
Sangakkara hit 13 fours and lifted Sri Lanka from 44 for three and early trouble after an hour delay at the start of the day in Durban because of rain.
By the time he lofted a mistimed drive to Graeme Smith at mid-on off leg-spinner Imran Tahir (2-64) to fall two balls after Chandimal and three overs from the close of play, the job was done.
Fast bowler Dale Steyn returned three for 54 for the home team but South Africa's frustration was evident with Steyn's verbal onslaught at Chandimal shortly before he got the young wicketkeeper-batsman out.