The Proteas took a first-innings lead of 71 as their tail propelled them to 404 on the third day of the second Test in Rawalpindi.
Senuran Muthusamy hit a career-best 89* and Kagiso Rabada 71 after Keshav Maharaj had scored 30 to help South Africa recover from 235-8.
Veteran spinner Asif Afridi took 6-79 on his Test debut.
Pakistan were bowled out for 333 in their first innings.
Kagiso ‘John Wick’ Rabada 💥
A maiden Test 50 👏
📺 Stream #PAKvSA on DStv: https://t.co/rM90YyR504#SSCricket pic.twitter.com/5OQmRCAIpV
— SuperSport 🏆 (@SuperSportTV) October 22, 2025
Photo: Sameer Ali/Getty Images