South Africa needed 243 runs to win on the final day, but Hasan, who bagged five wickets in the first innings, did well with the ball again and returned with the figures of 5-60 as South Africa collapsed to 274 all out after lunch on the last day.
Resuming overnight on 127/1, South Africa’s hopes of grinding down the target suffered early blows when Hasan had Rassie van der Dussen cleaned up in just the third ball of the day, two runs short of a half-century.
He then returned to have Faf du Plessis trapped in front for five, and South Africa’s prospects of chasing down 370 looked less convincing at 135/3.
However, Markram and Bavuma then got together to frustrate the home side. They put on 106 for the fourth wicket, during the course of which, Markram brought up his first Test century away from home, and fifth overall.
They took South Africa into lunch without further harm, at 219/3, and after they resumed, Bavuma brought up his half-century as well. However, once the second new ball was taken at the first opportunity, the game changed on its head.
In his first over with the new ball, Hasan had Markram (108) splaying an edge to slip. In his next ball, he had South Africa captain Quinton de Kock tempted into a drive and caught at second slip. South Africa were 243/5.
Wiaan Mulder joined Temba Bavuma, and the duo attempted to steady the innings again. But Shaheen Shah Afridi probed in that tight line outside off and eventually had Bavuma caught behind for 61. In the next over, Hasan was back at it, finding the edge of Linde.
Shaheen then dismissed Keshav Maharaj and Kagiso Rabada within three balls. In the next over, Yasir Shah finished things off with the wicket of Mulder for 20. (UNI)