JP Duminy and Stephen Cook scored half centuries but four wickets for Suranga Lakmal and two for Rangana Herath restricted South Africa to 267 for six on the opening day of the first test against Sri Lanka on Monday.
Duminy made 63 and Cook 59 as South Africa threatened to dominate on a dry track at St George's Park but wickets at key moments kept Sri Lanka firmly in the game.
Lakmal ended a 104-run opening partnership between Cook and Dean Elgar and took two more vital wickets to leave honours even at the start of the three-test series.
He removed both openers in quick succession as Sri Lanka produced a much improved bowling display after lunch.
Cook squared up to a delivery that straightened and Elgar went in Lakmal's next over for 45, tempted by a ball outside the off stump that he could have left alone.
Hashim Amla continued to look out of form and his footwork again proved his downfall as he was the third batsman caught by wicketkeeper Dinesh Chandimal off Lakmal for a laboured 20 off 107 balls.
But while Amla struggled, Duminy went after the seamers and raced to 50 off 73 balls but he was then pegged back before attempting to sweep Herath and being trapped lbw.
Herath had Temba Bavuma lbw for three after a review before Lakmal, who ended the day with figures of 4-62 and tantalisingly close to first test five-wicket haul, removed Faf du Plessis for 37 with the second new ball. The home captain was caught out by extra bounce and snapped up by Dimuth Karunaratne at first slip.
Quinton de Kock (25 not out) and Vernon Philander (6 not out) will resume on Tuesday.
Sri Lanka, who have lost eight of 10 previous tests in South Africa, will be pleased their a young side kept up their competitive edge after beating Australia at home this year and Zimbabwe away.
South Africa 267 for 6
(Duminy 63, Cook 59, Lakmal 4-62) v Sri Lanka