The Pakistani team Halts South Africa's 10-Test Unbeaten Run.
The left-arm pacer took a quartet of wickets in the final innings after failing to take a wicket in the first innings.
First Test, Lahore (day four)
Pakistan 378 (Imam-ul-Haq 93, Agha 93; Senuran Muthusamy 6-117) & 167 (Babar Azam 42; the spinner 5-57)
South Africa 269 (Tony de Zorzi 104; Noman Ali 6-112) & 183 (Brevis 54; Shaheen 4-33, Noman 4-79)
Pakistan won by 93 runs
Pakistan brought an end to the reigning champions South Africa's unbeaten run by sealing a 93-run margin triumph in an exciting and closely contested opening Test in the city of Lahore.
South Africa, whose 10-match unbeaten run in the longest format ended with a win against the Aussies in the WTC final in June, were dismissed for 183 in pursuit of 277.
Having resumed on 51-2, they lost century-maker Tony de Zorzi leg before wicket to left-arm quick Shaheen Afridi to the third delivery of the day to push the tightly balanced run chase in the home team's favour.
Left-arm spinner Noman Ali, who claimed 10-191 in the game, dismissed Stubbs for two and bowled Dewald Brevis, who put up a fight with a run-a-ball 54.
Off-spinner Sajid also capitalized on significant spin to end opener Ryan Rickelton's innings - he lasted 145 balls for 45 runs - and Afridi came back in the afternoon session to dismiss the lower order with a impressive exhibition of reverse-swing bowling.
He trapped Kyle Verreynne lbw for 19 and dismissed Subrayen and Rabada to secure the victory.
It was both sides' opening game of the 2025-2027 Test championship cycle and propels Pakistan straight into the number two spot behind table-toppers the Australian team.
The win was built around key performances of ninety-three by opening batsman Imam and, importantly, number seven Agha which lifted them to 378.
After that slow bowlers Noman Ali and Sajid Khan utilized favourable home conditions, as they did in their Test series win over England the previous year, to maintain their advantage.
The second and final Test begins on October 20.