Pakistan Ends the Proteas' 10-match Victory Run.
The left-arm pacer secured four wickets in the final innings after failing to take a wicket in the first innings.
First Test, Lahore (the fourth day)
Pakistan 378 (Imam-ul-Haq 93, Agha 93; Muthusamy 6-117) & 167 (Babar 42; the spinner 5-57)
South Africa 269 (De Zorzi 104; Noman 6-112) & 183 (Dewald Brevis 54; Shaheen 4-33, Noman Ali 4-79)
Pakistan won by 93 runs
The national team terminated world champions South Africa's winning streak by achieving a 93-run win in an thrilling and closely contested first Test in the city of Lahore.
The Proteas, whose 10-match unbeaten run in Test cricket culminated in a win against the Aussies in the WTC final in June, were dismissed for 183 chasing 277.
Starting the day on 51 for two, they saw the dismissal of century-maker Tony de Zorzi leg before wicket to pace bowler Afridi to the third ball of the day to push the finely-poised chase in the home team's favour.
Left-arm spinner Noman, who took 10 wickets for 191 runs in the match, dismissed Tristan Stubbs for two and clean bowled Dewald Brevis, who offered some resistance with a rapid 54.
Right-arm spinner Sajid also capitalized on significant spin to end opening batsman Rickelton's stay - he faced 145 balls for 45 runs - and Shaheen came back in the post-lunch session to knock over the lower order with a impressive exhibition of reverse-swing bowling.
He had Kyle Verreynne leg before for nineteen and dismissed Subrayen and Rabada to secure the victory.
It was both sides' first match of the 2025-27 World Test Championship cycle and propels the hosts directly into second place after table-toppers Australia.
The win was founded on key performances of ninety-three by opening batsman Imam and, crucially, all-rounder Salman Agha which lifted them to 378.
After that spinners Noman Ali and Sajid Khan took advantage of favourable home conditions, as they had in their Test series win over England the previous year, to maintain their advantage.
The next and final Test starts on 20 October.