Galle, Sri Lanka: A.B. de Villiers made a speedy 51 Saturday as South Africa declared its second innings on 206-6 at tea to set Sri Lanka a near-impossible target of 370 to win the first test.
No side has scored over 300 in a run chase at Galle.
De Villiers hit six fours off 58 deliveries during his 36th half century to ensure the visitors called the shots on the fourth day after gaining a 163-run first innings lead.
De Villiers took charge after Faf du Plessis (37) and captain Hashim Amla (22) failed to get big knocks with both out after lunch.
It proved to be a competitive second session as South Africa added 143 runs while Sri Lanka bagged four wickets.
In the opening session, first innings centurion Dean Elgar was caught behind off Rangana Herath for 12, playing away from the body, while Alviro Petersen (32) edged one off Dilruwan Perera.
For Sri Lanka, off-spinner Dilruwan Perera took 4-79 in friendly spin bowling conditions.
Earlier, Sri Lanka added just nine runs to its overnight first-innings score before losing its last wicket and finishing on 292, well short of South Africa's first innings 455-9 declared.
Last-man Shaminda Eranga, who came in to bat for Sri Lanka despite a hand injury that restricted his pace bowling to just nine overs in the first innings, remained not out on 1.
Morkel finished with 3-49 while Dale Steyn remained the most successful bowler for South Africa with 5-54.