The Pakistani team Halts the Proteas' 10-match Unbeaten Run.
The left-arm pacer secured four wickets in the second innings after going wicketless in the first session.
Opening Test, Lahore (the fourth day)
The home side 378 (Imam-ul-Haq 93, Salman Agha 93; Senuran Muthusamy 6-117) & 167 (Babar Azam 42; Muthusamy 5-57)
South Africa 269 (De Zorzi 104; Noman Ali 6-112) & 183 (Dewald Brevis 54; Shaheen 4-33, Noman Ali 4-79)
Pakistan won by 93 runs
Pakistan terminated the reigning champions the Proteas' unbeaten run by completing a 93-run victory in an entertaining and closely contested opening Test in the city of Lahore.
The Proteas, who had a 10-match winning streak in the longest format ended with a win against Australia in the World Test Championship final in the month of June, were bowled out for 183 chasing 277.
Having resumed on 51 for two, they saw the dismissal of first-innings centurion Tony de Zorzi lbw to pace bowler Afridi to the third ball of the day to shift the tightly balanced run chase in the home team's favor.
Left-arm spinner Noman Ali, who secured 10 wickets for 191 runs in the game, dismissed Stubbs for two and clean bowled Dewald Brevis, who put up a fight with a run-a-ball 54.
Right-arm spinner Sajid also capitalized on significant spin to end opener Rickelton's innings - he faced 145 deliveries for 45 - and Afridi came back in the post-lunch session to knock over the tail with a fine display of reverse swing.
He trapped Kyle Verreynne lbw for 19 and dismissed Subrayen and Rabada to seal the victory.
It was both sides' first match of the 2025-2027 World Test Championship cycle and propels Pakistan directly into second place after leaders the Australian team.
The win was founded on contributions of ninety-three by opening batsman Imam and, importantly, number seven Salman Agha which boosted them to three hundred and seventy-eight.
After that slow bowlers Noman and Sajid Khan took advantage of helpful home pitches, as they had in their series victory over England the previous year, to sustain their advantage.
The next and final Test begins on October 20.