The Pakistani team Ends South Africa's 10-match Unbeaten Run.
Shaheen Afridi took a quartet of wickets in the final innings after failing to take a wicket in the first innings.
Opening Test, Lahore (the fourth day)
The home side 378 (Imam-ul-Haq 93, Agha 93; Senuran Muthusamy 6-117) & 167 (Babar 42; the spinner 5-57)
South Africa 269 (Tony de Zorzi 104; Noman 6-112) & 183 (Dewald Brevis 54; Shaheen 4-33, Noman 4-79)
Pakistan won by 93 runs
The national team brought an end to the reigning champions South Africa's unbeaten run by achieving a 93-run triumph in an exciting and hard-fought first Test in the city of Lahore.
South Africa, whose 10-match winning streak 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 for two, they lost first-innings centurion Tony de Zorzi lbw to left-arm quick Afridi to the third ball of the day to push the tightly balanced chase in the home team's favor.
Slow left-armer Noman Ali, who secured 10 wickets for 191 runs in the game, removed Stubbs for 2 and clean bowled Brevis, who put up a fight with a run-a-ball 54.
Right-arm spinner Sajid Khan also took advantage of significant spin to end opener Ryan Rickelton's innings - he faced 145 balls for 45 - and Afridi returned in the post-lunch session to dismiss the lower order with a fine display of reverse-swing bowling.
He had Kyle Verreynne lbw for nineteen and dismissed Subrayen and Kagiso Rabada to secure the victory.
It was both sides' opening game of the 2025-27 Test championship cycle and propels the hosts straight into second place after leaders the Australian team.
The win was founded on key performances of 93 by opening batsman Imam-ul-Haq and, crucially, number seven Salman Agha which boosted them to three hundred and seventy-eight.
From there spinners Noman and Sajid Khan took advantage of favourable home conditions, as they had in their series victory over England the previous year, to sustain their advantage.
The second and final Test starts on 20 October.