Ryan Rickelton achieved his first double century, scoring an impressive 213, leading South Africa to a total of 429-5 on Day 2.
Kyle Verreynne contributed with a quick-fire 74, sharing a pivotal 106-run partnership with Rickelton for the sixth wicket.
The duo helped South Africa recover after losing an early wicket, with Rickelton's knock featuring 25 fours and 1 six.
Pakistan's bowling attack struggled, particularly as Naseem Shah was rested, and they failed to make significant early inroads into the South African lineup.
This match marks after South Africa's victory in the previous Test, solidifying their spot in the upcoming World Test Championship final.