Gary Kirsten scored a priceless 130 before attempting a lofted straight drive and skied Kabir Ali to mid-on to end his 323-ball marathon, giving the bowler his third wicket on debut.
South Africa were all out for 342 in their first innings, with Makhaya Ntini unbeaten on 32.