Shan Masood and Noman Ali celebrate Dewald Brevis' wicket • Getty Images
Pakistan 378 and 167 (Babar 42, Muthusamy 5-57, Harmer 4-51) beat South Africa 269 and 183 (Brevis 54, Rickelton 45, Afridi 4-33, Noman 4-79) by 93 runs
Ultimately, reality had to bite. 276 has never been chased at the Gaddafi, and the prospect has become even more unlikely since Pakistan pivoted to rapidly deteriorating spin tracks. South Africa gamely hung around till deep into the middle session, but they had been cut too far adrift, and kept losing too many wickets. Shaheen Shah Afridi polished off the tail after Pakistan's spinners made early inroads, sealing a 93-run win that breaks South Africa's record 10-Test win streak.
Pakistan's nerves had been settled at lunch with the dismissal of the dangerous and the dogged - Ryan Rickelton and Dewald Brevis both falling to superb deliveries from Sajid Khan and Noman Ali. Senuran Muthuswamy was trapped in front shortly after the resumption, and for the next half hour both sides appeared to be going through the motions. Kyle Verreynne and Simon Harmer hung around without really making a charge towards the total, while Pakistan's spin kept plugging away, but without the intensity before the break. Slowly, South Africa edged past Pakistan's third innings total, the first time since Pakistan have prepared these tracks that the fourth innings has outscored the third.
The reintroduction of Afridi broke the game open, though. Coming around the wicket, he found reverse with the ageing ball on the ageing surface, viciously dipping one back into Verreynne that struck him so square Afridi never turned around to confirm the umpire agreed with his assessment that ball was hitting the stumps.
Numbers 10 and 11 were easy work for an amped up Afridi, who sensed an opportunity to pad his figures up in a game where his relevance to the side had hitherto been limited. Prenelan Subrayen and Kagiso Rabada had no answer for the swinging yorkers that rattled their stumps, sealing a win that had perhaps been secured when Pakistan ran up a large total in the first two sessions of the first day.
A lively session of cricket had broken out in the morning in Lahore with Brevis taking the attack to Pakistan. The 22-year-old, playing just his third Test match, threatened to pull off the spectacular with a run-a-ball 54 but was unable to sustain such a breakneck tempo on a wearing subcontinent pitch. Noman took back the spotlight that South Africa have been trying to take away from him through the course of this entire game, bringing up his third Test-match 10-for and putting Pakistan on the road to victory. At lunch, they were four wickets off and had 139 runs with which to buy them.
Nothing like this target of 277 has ever been chased before in a Test match in Lahore and that record seemed set to continue when the first four overs of Wednesday's play yielded two wickets and just five runs. Afridi went through Tony de Zorzi's defence with his third ball and the worry the visitors had about new batters struggling to find rhythm in these conditions came to pass. Tristan Stubbs only lasted eight balls before reverse sweeping Noman to Salman Agha at slip, who now has five catches in the match.
South Africa's overnight 51 for 2 had become 55 for 4 when Brevis walked in. He took a little time to get acclimatised and then, in the 34th over, he charged out to meet a half-volley from Noman and smacked it over mid-off. A slog sweep for six and a heave over midwicket for four followed, giving the young batter all the confidence he needed to trust in his attacking instincts. The battle between Brevis and Pakistan peaked when he hit a no-look six over long-on to bring up his half-century.
Noman had been the recipient of most of Brevis' punishment, but the canny left-arm spinner knew all he needed was one ball in the right area. That came in the seventh over before lunch when a ball fired into the pitch gripped well enough to turn right past the defending batter and clatter into the stumps. Brevis fell for 54 off 54 with six of South Africa's 10 fours and all of their two sixes in the final innings.
That was Noman's 10th wicket of the match. Sajid, his spin-bowling partner, chipped in with one as well when he dismissed the other set batter, Ryan Rickelton, for 45 off 145 deliveries as Pakistan went to the break consolidating the upper hand they've had since the first day's play.
South Africa spent the best part of four days trying to claw back that advantage, and while they took Pakistan the distance, it was a task which proved just a bridge too far, even for the world champions.