The Pakistani team Halts South Africa's 10-match Unbeaten Run.
The left-arm pacer secured a quartet of wickets in the second innings following failing to take a wicket in the first session.
First Test, the Gaddafi Stadium (the fourth day)
The home side 378 (Imam 93, Salman Agha 93; Muthusamy 6-117) & 167 (Babar Azam 42; Muthusamy 5-57)
The visitors 269 (Tony de Zorzi 104; Noman 6-112) & 183 (Brevis 54; Shaheen 4-33, Noman Ali 4-79)
The hosts secured a 93-run victory
Pakistan brought an end to world champions South Africa's winning streak by achieving a 93-run victory in an thrilling and hard-fought opening Test in the city of Lahore.
The Proteas, who had a 10-Test winning streak in the longest format ended with a win against Australia in the World Test Championship final in June, were dismissed for 183 chasing 277.
Starting the day on 51-2, they saw the dismissal of century-maker De Zorzi leg before wicket to pace bowler Afridi to the third delivery of the day to shift the finely-poised run chase in the home team's favour.
Slow left-armer Noman Ali, who secured 10-191 in the match, removed Tristan Stubbs for 2 and clean bowled Dewald Brevis, who offered some resistance with a run-a-ball 54.
Right-arm spinner Sajid Khan also capitalized on significant spin to end opening batsman Rickelton's innings - he lasted 145 balls for 45 - and Afridi came back in the post-lunch session to knock over the lower order with a fine display of reverse swing.
He trapped Verreynne lbw for 19 and bowled Prenelan Subrayen and Rabada to seal the win.
It was both sides' first match of the 2025-27 World Test Championship cycle and moves the hosts straight into second place after table-toppers Australia.
Their victory was built around key performances of ninety-three by opener Imam-ul-Haq and, crucially, number seven Salman Agha which lifted them to 378.
From there spinners Noman and Sajid Khan took advantage of favourable home conditions, as they had in their Test series win over the English team the previous year, to sustain their advantage.
The next and final Test starts on 20 October.