For South Africa, Aiden Markram struck a valiant century, his first on foreign soil, but it was not enough as South Africa suffered their first Test series defeat to Pakistan since 2003.
Markram scored 108 (243 balls, 13 fours, 3 sixes), although he didn't find much support from other Proteas batsman. Only Temba Bavuma (61 off 125 balls, 6 fours) offered any real backing as Mark Boucher's side slipped from their promising position of 127/1 on Day 4 to another defeat. South Africa had lost the first Test by seven wickets in Karachi.
Things could have gone much better had they not lost the overnight batsman Rassie van der Dussen so early in the day for 48. The South Africa No. 3 batsman was cleaned up on the third ball of the day by Ali to end a battling 94-run stand.
The visitors were dealt another blow when former captain Faf du Plessis lasted only 13 deliveries before he was sent back to the pavilion by the same bowler, trapped leg before wicket for five.
The Proteas suddenly found themselves under pressure on 135/3.
Markram and Bavuma got together for a 106-run fourth-wicket vigil that took the home side to within 129 runs of victory.
Along the way, Markram completed his fifth Test ton and his highest score away from home, beating the 74 he made in the second innings in Karachi.
But that was as good as it got as the new ball then proved decisive. Pakistan needed just 11.4 overs to clean up the visitors' line-up from the time they took it after 80 overs.
The centurion and Quinton de Kock (0) were dismissed from successive Ali deliveries. Bavuma then fell to Afridi just over five overs later, having completed a 15th career half-century a little earlier.
George Linde (4) was next to go when he was caught by Faheem Ashraf off Ali at point, while Afridi took out Keshav Maharaj (0) and Kagiso Rabada (0) within three deliveries.
Wiaan Mulder was then the last man out, bowled by Yasir Shah for 20, handing Pakistan the win.
Ali was named the man of the match while Pakistan wicket-keeper Mohammad Rizwan was adjudged the player of the series as he accumulated 166 runs in the three innings he batted.
The two teams will now face each other in a three-match T20I series to be played at the Gaddafi Stadium in Lahore from Thursday.
Brief scores: Pakistan 272 and 298 beat South Africa 204 and 274 (Aiden Markram 108, Temba Bavuma 61; Hasan Ali 5/60) by 95 runs.
(Only the headline and picture of this report may have been reworked by the Business Standard staff; the rest of the content is auto-generated from a syndicated feed.)
Business Standard has always strived hard to provide up-to-date information and commentary on developments that are of interest to you and have wider political and economic implications for the country and the world. Your encouragement and constant feedback on how to improve our offering have only made our resolve and commitment to these ideals stronger. Even during these difficult times arising out of Covid-19, we continue to remain committed to keeping you informed and updated with credible news, authoritative views and incisive commentary on topical issues of relevance.
We, however, have a request.
As we battle the economic impact of the pandemic, we need your support even more, so that we can continue to offer you more quality content. Our subscription model has seen an encouraging response from many of you, who have subscribed to our online content. More subscription to our online content can only help us achieve the goals of offering you even better and more relevant content. We believe in free, fair and credible journalism. Your support through more subscriptions can help us practise the journalism to which we are committed.
Support quality journalism and subscribe to Business Standard.