The Pakistani team Ends the Proteas' 10-match Unbeaten Run.
The left-arm pacer secured a quartet of wickets in the second innings after failing to take a wicket in the initial session.
First Test, Lahore (day four)
The home side 378 (Imam-ul-Haq 93, Agha 93; Senuran 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)
The hosts secured a 93-run victory
The national team halted world champions South Africa's winning streak by sealing a 93-run margin victory in an thrilling and competitive opening Test in Lahore.
South Africa, whose 10-Test winning streak in the longest format ended with a win against Australia in the World Test Championship final in the month of June, were dismissed for 183 in pursuit of 277.
Starting the day on 51-2, they lost first-innings centurion De Zorzi lbw to pace bowler Afridi to the third delivery of the day to shift the tightly balanced run chase in the home team's favor.
Slow left-armer Noman, who secured 10 wickets for 191 runs in the match, dismissed Tristan Stubbs for two and bowled Dewald Brevis, who offered some resistance with a rapid 54.
Off-spinner Sajid Khan also capitalized on significant spin to end opener Rickelton's stay - he faced 145 balls for 45 runs - and Shaheen returned in the afternoon session to dismiss the lower order with a impressive exhibition of reverse-swing bowling.
He had Verreynne leg before for nineteen and dismissed Subrayen and Rabada to secure the victory.
It was each team's opening game of the 2025-2027 Test championship cycle and propels Pakistan directly into the number two spot behind table-toppers Australia.
The win was built around key performances of 93 by opening batsman Imam and, importantly, number seven Agha which lifted them to 378.
After that spinners Noman Ali and Sajid utilized favourable home conditions, as they had in their series victory over England last year, to sustain their advantage.
The next and last match begins on 20 October.