Akila Dananjaya back in Sri Lanka ODI squad after coming clean with bowling action.
Kusal Perera scored a 200-ball unbeaten 153 as the visitors sealed a one-wicket win in Durban.
Set a target of 304 to win, Sri Lanka were 83 for three when bad light brought a premature end to proceedings.
Dale Steyn grabs four as Proteas take advantage on second day of first Test.
Sri Lanka on top despite Quinton de Kock resistance in the opening day of the first Test at Durban on Wednesday.
Sri Lanka drops skipper Chandimal from SA tour, Karunaratne named captain.