Cape Town: South Africa need six more wickets with two days still to play to win the second Test against Sri Lanka, who closed the third day at Newlands on Wednesday on 130 for four, still 377 runs behind the mammoth target set them.
Vernon Philander and Kagiso Rabada both took two wickets in the Sri Lankan second innings as the home team closed in on victory and an unassailable 2-0 lead in the series.
South Africa have ample time to whittle away the rest of the Sri Lankan batting while the visitors, set 507 runs to win, must survive six more sessions if they are to force a most improbable outcome.
Angelo Mathews (29 not out) and Dinesh Chandimal (28 not out) will resume on Thursday, having shown some resistance to the close of play with an unbeaten 61-run partnership.
Philander made an early inroad before tea when he clean bowled Dimuth Karunaratne for six and then added the wicket of Kusal Mendis after the break as he edged a ball on a tempting length to Dean Elgar for only four.
Kaushal Silva went for 29 runs when a rising Rabada delivery hit him on the glove and popped up for an easy catch for Stephen Cook.
Dhananjaya de Silva was then given out leg before wicket off a Rabada delivery that was heading down leg side but surprisingly did not ask for a review. Had he done so, De Silva would have been able to add to his 22 runs.
Sri Lanka were put into bat midway through the second session after the South African lead went past 500 runs. They declared on 224 for seven, having resumed at 35-0 overnight.
Seamer Suranga Lakmal took four wickets in a rare highlight for Sri Lanka while Elgar top scored for the home side with 55, to add to his first-innings century.
Captain Faf du Plessis made 41 while Stephen Cook was out for 30.
South Africa scored 392 in their first innings to which Sri Lanka replied with a paltry 110. The hosts, who won the first test in Port Elizabeth last week, did not enforce the follow-on.
South Africa 1st innings: 392 (D. Elgar 129, Q. de Kock 101; L. Kumara 6-122)
Sri Lanka 1st innings: 110 (V. Philander 4-27, K. Rabada 4-37)
South Africa 2nd innings:
S. Cook c Karunaratne b Lakmal 30
D. Elgar c Mathews b Herath 55
H. Amla c Chandimal b Lakmal 0
J. Duminy lbw b Lakmal 30
F. du Plessis c Chandimal b Lakmal 41
T. Bavuma run out (D. de Silva) 0
Q. de Kock c Chandimal b Kumara 29
K. Maharaj not out 20
V. Philander not out 15
Extras (nb-3, w-1) 4
Total (for 7 wickets decl., 51.5 overs) 224
Fall of wickets: 1-64, 2-64, 3-110, 4-136, 5-137, 6-170, 7-192
Did not bat: K. Abbott, K. Rabada
Bowling: S. Lakmal 19.5-2-69-4, N. Pradeep 11-0-46-0 (nb-1), L. Kumara 12-0-62-1 (w-1), D. de Silva 3-0-15-0, R. Herath 6-0-32-1
Sri Lanka 2nd innings:
D. Karunaratne b Philander 6
K. Silva c Cook b Rabada 29
K. Mendis c Elgar b Philander 4
D. de Silva lbw b Rabada 22
A. Mathews not out 29
D. Chandimal not out 28
Extras (b-6, lb-5, nb-1) 12
Total (for 4 wickets, 40 overs) 130
Fall of wickets: 1-11, 2-25, 3-66, 4-69
To bat: U. Tharanga, R. Herath, S. Lakmal, N. Pradeep, L. Kumara
Bowling: K. Abbott 10-3-23-0, V. Philander 10-1-34-2 (nb-1), K. Rabada 10-3-22-2, K. Maharaj 10-2-40-0
Umpires: Aleem Dar & Rod Tucker
TV umpire: Bruce Oxenford
Match referee: David Boon