Shaheen Afridi took a quartet of wickets in the second innings following going wicketless in the first innings.
First Test, the Gaddafi Stadium (day four)
The home side 378 (Imam-ul-Haq 93, Salman Agha 93; Senuran Muthusamy 6-117) & 167 (Babar 42; the spinner 5-57)
South Africa 269 (De Zorzi 104; Noman Ali 6-112) & 183 (Dewald Brevis 54; Shaheen Afridi 4-33, Noman 4-79)
Pakistan won by 93 runs
The national team terminated world champions the Proteas' unbeaten run by completing a 93-run margin victory in an thrilling and competitive opening Test in Lahore.
South Africa, who had a 10-match unbeaten run in the longest format ended with a win against Australia in the WTC final in the month of June, were bowled out for 183 chasing 277.
Having resumed on 51 for two, they saw the dismissal of first-innings centurion Tony de Zorzi leg before wicket to left-arm quick Afridi to the third delivery of the day to shift the finely-poised run chase in Pakistan's favor.
Left-arm spinner Noman Ali, who took 10 wickets for 191 runs in the match, removed Stubbs for 2 and clean bowled Dewald Brevis, who offered some resistance with a run-a-ball 54.
Right-arm spinner Sajid also capitalized on sharp turn to terminate opener Ryan Rickelton's stay - he faced 145 deliveries for 45 runs - and Afridi came back in the post-lunch session to knock over the tail with a fine display of reverse-swing bowling.
He trapped Kyle Verreynne lbw for nineteen and bowled Prenelan Subrayen and Rabada to seal the victory.
It was each team's opening game of the 2025-27 Test championship cycle and propels Pakistan straight into the number two spot behind table-toppers the Australian team.
The win was built around key performances of ninety-three by opener Imam and, crucially, number seven Salman Agha which lifted them to three hundred and seventy-eight.
After that spinners Noman and Sajid utilized helpful home pitches, as they did in their Test series win over the English team last year, to sustain their advantage.