Sri Lanka 338 (Samaraweera 102, Chandimal 58, de Lange 7-81) and 7 for 1 lead South Africa 168 (Amla 54, Welegedara 5-52, Herath 4-49) by 177 runs
Scorecard and ball-by-ball details

In what has already been a champagne year for Test cricket, Chanaka Welegedara and Rangana Herath set Sri Lanka up for what could be the biggest Test upset of 2011. There were no signs of Durban's famed Green Mamba - tides which are rumoured to make the Kingsmead track juicy - but that didn't prevent South Africa from being knocked over for their lowest total against Sri Lanka. While the lower order had to deal with some sharp spin, the specialist batsmen didn't have to face any snorters, which makes the collapse more baffling.

An assured stand of 76 for the fourth wicket between Hashim Amla and AB de Villiers showed how few gremlins there were in the surface, but collapses on either side of that partnership had South Africa scrambling to avert the follow-on. Their tail managed to achieve that, before Welegedara completed his five-for and ended the innings by getting Marchant de Lange to edge to the keeper. de Lange's 7 for 81 had limited Sri Lanka to 338 in the morning, but instead of a well-earned rest after becoming the eighth debutant to take a five-wicket haul this year, he had to bat in the gloom towards the end of the day.

The substantial lead of 170 did not seem likely even after Thilan Samaraweera became only the second Sri Lanka batsman to make a Test century in South Africa. de Lange had ripped out the final three batsmen for three runs, but unfortunately for the home fans the wickets continued to tumble even when South Africa were batting.

Two overs after lunch, Jacques Rudolph continued the trend of batsmen throwing away their wickets, by helping a short ball on leg stump to deep-backward square leg. Graeme Smith followed minutes later, as he fished without footwork at a Chanaka Welegedara delivery to give wicketkeeper Dinesh Chandimal his first Test catch. It got a lot worse in Welegedara's next over as Jacques Kallis edged to slip to collect a rare Test duck, leaving South Africa at 27 for 3.

South Africa still had two of their most bankable batsmen in the middle - Amla and de Villiers - and they revived the home side by comfortably playing out the rest of the session. de Villiers was subdued, but Amla showed his wide range of whiplash shots through the off side. There were several punches through cover for four and the point boundary was peppered as he pounced on the wide deliveries offered. Dilhara Fernando, regarded as the spearhead of the Sri Lankan attack, was only brought on as the fourth-change bowler, but even his introduction didn't stop Amla, who lashed three fours in one over to cruise towards another half-century.

If South Africa were breathing easier at tea, when they were 100 for 3, they were left gasping by what followed after the break. de Villiers chased a half-volley so wide that he ended up on his knees as he edged the ball to second slip. Welegedara had his fourth important wicket two overs later when Amla was caught behind pushing at a delivery angling across.

That put Sri Lanka in charge, and two players whose places in the South Africa side are under scrutiny were left to launch a rescue effort. Questions over Mark Boucher's batting ability will intensify after his poke to gully off Rangana Herath for 3, but there will be even more pressure on Ashwell Prince after his botched reverse-sweep against the spin, that too when South Africa were 119 for 6. With Herath proving too good for Morne Morkel, South Africa had lost five for 16.

Dale Steyn didn't get a wicket in a completed Test innings for the first time since 2008, but he still made a crucial contribution as he shepherded South Africa past the follow-on mark. The final two wickets put on 49, again showing that this wasn't a pitch impossible to bat on.

South Africa's capitulation made Samaraweera's century - only his second outside Asia -even more significant. He and Herath defied the home side for more than an hour in contrasting style: Samaraweera was 14 short of his hundred overnight and was in no hurry to reach the landmark, while Herath swung at everything, playing some comical yet effective flat-batted swipes against the hulking fast bowlers.

Samaraweera got to his century soon after drinks, pushing the ball towards cover for two, before exuberantly celebrating the milestone by pretending to shoot at someone in the dressing room. Herath was also enjoying himself, with consecutive boundaries, both confident steers past cover point as Sri Lanka moved to 335 for 7 before de Lange's burst brought the innings to a quick end.

South Africa had some cheer late in the day, when Tillakaratne Dilshan perished for 4, but Sri Lanka are still in pole position to extend the home side's Durban jinx.

Siddarth Ravindran is a sub-editor at ESPNcricinfo