South Africa edged into a narrow lead on day two of the first Test versus Pakistan, with debutant Corbin Bosch hitting a half-century before the tourists lost their way with the bat.

Bosch finished unbeaten on 81 as the Proteas, who resumed at 82-3, were bowled out for 301 at Centurion.

He hit 15 fours in 93 balls faced to rescue South Africa's first innings after they were dropped to 213-8, with Naseem Shah and Khurram Shahzad dismissing three apiece for Pakistan and Aiden Markram top scoring with 89 runs for the hosts.

Taking the ball with a 90-run first-innings advantage, South Africa initially struggled to make progress, with Saim Ayub and Shan Masood putting on 49 for the first wicket before Kagiso Rabada sent the former walking for 27 with a ferocious delivery.

Rocked by that breakthrough, Pakistan lost their next two wickets within the space of two overs, with Masood (28) and Kamran Ghulam (four) being caught off Marco Jansen's bowling.

With Babar Azam (16*) and Saud Shakeel (8*) at the crease, Pakistan will resume at 88-3 on Saturday, with South Africa targeting a victory that would guarantee a place in the World Test Championship final.

Data Debrief: Dream debut for Bosch

Bosch could hardly have asked for a better Test debut.

Having finished with figures of 4-63 in Pakistan's first innings, he then took up the bat with his team reeling and put on a fine show.

His unbeaten score of 81 is the highest ever recorded by a debutant batting at number nine in Tests, ahead of Milan Rathnayake's 72 for Sri Lanka against England in August.