The Pakistani team Ends South Africa's 10-match Unbeaten Run.
The left-arm pacer took a quartet of wickets in the second innings after going wicketless in the initial session.
Opening Test, the Gaddafi Stadium (the fourth day)
The home side 378 (Imam 93, Salman Agha 93; Senuran Muthusamy 6-117) & 167 (Babar 42; Muthusamy 5-57)
South Africa 269 (Tony de Zorzi 104; Noman Ali 6-112) & 183 (Brevis 54; Shaheen Afridi 4-33, Noman Ali 4-79)
Pakistan won by 93 runs
The national team brought an end to the reigning champions the Proteas' winning streak by completing a 93-run margin victory in an exciting and hard-fought opening Test in the city of Lahore.
The Proteas, who had a 10-Test winning streak in Test cricket culminated in a win against the Aussies in the WTC final in the month of June, were dismissed for 183 chasing 277.
Having resumed on 51-2, they saw the dismissal of first-innings centurion De Zorzi lbw to pace bowler Afridi to the third ball of the day to push the tightly balanced run chase in Pakistan's favor.
Left-arm spinner Noman, who secured 10-191 in the match, removed Tristan Stubbs for 2 and clean bowled Brevis, who put up a fight with a rapid 54.
Right-arm spinner Sajid also took advantage of sharp turn to terminate opener Rickelton's stay - he lasted 145 balls for 45 - and Afridi came back in the post-lunch session to knock over the lower order with a impressive exhibition of reverse swing.
He trapped Kyle Verreynne leg before for nineteen and bowled Subrayen and Kagiso Rabada to seal the victory.
It was both sides' first match of the 2025-2027 World Test Championship cycle and moves Pakistan directly into the number two spot after leaders the Australian team.
The win was founded on key performances of ninety-three by opener Imam-ul-Haq and, importantly, number seven Agha which boosted them to three hundred and seventy-eight.
After that spinners Noman and Sajid utilized favourable home conditions, as they had in their Test series win over England the previous year, to maintain their advantage.
The second and last match starts on 20 October.