Pakistan were 100 for three at the close, a lead of 112. Peterson hit 84 to enable South Africa to get within 12 runs of Pakistan’s first innings total of 338 and Steyn bowled at blistering pace to take two wickets as Pakistan lost their first three second innings wickets for 45 runs.
At that stage South Africa were slightly on top but Azhar Ali and captain Misbah-ul-Haq shared a largely cautious unbeaten partnership of 55 to see Pakistan through to the close without further loss.
32 photos from Sidharth Malhotra's Instagram album you must see
In pictures: 'Centurion' Virat Kohli and the art of chasing
Spotted: Sushant Singh Rajput at Kriti Sanon's house in Mumbai
Photos: 'Yeh Hai Mohabbatein' actress Karishma Sharma strips for shoot
Photos: Celebrities at Mumbai Marathon 2017