Sri Lanka took another giant step towards sweeping the two-match Test series by reducing South Africa to 139 for five in the third of the second Test match at Colombo.
Sri Lanka need just five wickets to inflict another confidence-denting defeat on South Africa and sweep the series.
Set an improbable target of 490 to level the series, South Africa did put up a better show with the bat but were considerably behind the need of the hour. The third day Colombo pitch assisted the Lankan spin troika of Herath, Perera and Dananjaya to a great deal, with all of them extracting vicious turn and bounce to have the visiting batsmen huffing and puffing.
Against batsmen who clearly decided that attack was the best form of defence, off-spinner Akila Dananjaya and left-arm spinner Rangana Herath took two wickets apiece, with off-spinner Dilruwan Perera also dismissing Dean Elgar.
The wickets fell despite repeated errors from Sri Lanka, who dropped two catches and could have had Elgar out twice beforehand had Perera not overstepped when bowling the delivery that dismissed him.
But this will likely have only delayed the South Africans' first series defeat by Sri Lanka since 2006. There are only three recognised batsmen remaining and two full days left to survive.
By stumps, number three batsman Theunis de Bruyn, who survived two very close lbw shouts early in his innings, was 45 not out, with a chance of recording his team's first half-century of the series.
Temba Bavuma, who came to the crease with Dananjaya on a hat-trick, remained 14 not out.
South Africa's most senior batsmen, Hashim Amla and Faf du Plessis, could not muster significant innings.
Amla had his off stump levelled by a straightening Herath delivery for six. Du Plessis was the first victim in Dananjaya's late double strike when a ball he had inside-edged on to his pad popped up for a catch to slip for seven.
Earlier, Sri Lanka added a further 125 runs to their already-mammoth 364-run lead, as acting captain Suranga Lakmal delayed the declaration until after halfway through the second session.
Dimuth Karunaratne made 85 -- the third time in four innings he has top-scored for Sri Lanka -- while Angelo Mathews completed a 29th career half-century before eventually being dismissed for 71.
Those were the only two breakthroughs South Africa could manage, as Sri Lanka's batsmen negotiated testing spells from the opposition quicks and their lone frontline spinner.
Left-arm spinner Keshav Maharaj took his match tally of wickets to 12 when he had Mathews caught at slip, and fast bowler Lungi Ngidi was the man to remove Karunaratne, having him caught behind for 85.
Dale Steyn went wicketless in this match, which means he has not yet broken the South Africa record for most wickets.
Steyn has been tied with Shaun Pollock at the top of his country's wicket-takers' list since the first Test in Galle, with 421 dismissals.
South Africa have not been whitewashed anywhere in the world since the two-Test series in Sri Lanka in 2006.
Their bowlers toiled for 47 overs on Sunday but managed to dismiss just the overnight pair of Karunaratne and Mathews.