Noman Ali has been Shan Masood's trump card in Lahore • Getty Images
South Africa 51 for 2 (Rickelton 29*, Noman 2-20) and 269 (de Zorzi 104, Noman 6-112, Sajid 3-98) need another 226 runs to beat Pakistan 167 (Babar 42, Muthusamy 5-57, Harmer 4-51) and 378 (Agha 93, Imam 93, Muthusamy 6-117)
Pakistan are eight wickets away from ending South Africa's ten-match winning streak in Test cricket after asking them to complete the highest successful chase in Lahore and second-highest in Pakistan. A target of 277 looks far away with the visitors 51 for 2 at stumps on the third day.
In a match that has played to script, Pakistan won the toss, batted first, took a 109-run innings lead and scored quickly in their second go to leave South Africa in a battle for survival. Spinners have been the key protagonists, led by Senuran Muthusamy who finished with career-best match figures of 11 for 174, including a second five-for. Muthusamy's haul is the fourth-best by a South African spinner but that is unlikely to be enough to help them win the game.
Instead, it is Noman Ali who will take the headlines after picking up his fifth successive Test five-for earlier in the day and, adding to that haul, two second-innings wickets as well to set Pakistan on their way.
The day began with South Africa's first innings still standing. There were four wickets left and Sajid Khan took one of them when Muthusamy edged him to slip, where Salman Agha claimed a sharp catch.
With the score 228 for 7, Tony de Zorzi had a decision to make. He was 81 overnight. A swing across the line for four against Sajid and a strike over long-off for six against Noman made it clear what his plans were going to be. De Zorzi reverse-swept Noman for a single to bring up a hard-fought hundred, which was the second of his Test career and second in the subcontinent.
With the second new ball looming, de Zorzi sought to be as aggressive as possible but it was his undoing. He advanced on Noman and swung hard but only got the ball as far as Shaheen Shah Afridi on the long-on boundary to give Noman a five-for. South Africa made it to the second new ball, Pakistan took it and gave it to their spinners, and it took Noman eight balls to strike. Prenalen Subrayen tried to defend but got an edge and Agha was in action again to take another good catch at slip. Noman finished with 6 for 112.
With a first innings lead of 109, Pakistan could afford early losses and risky strokeplay. Imam-ul-Haq was the first to fall when he shimmied down the pitch to drive Simon Harmer through the offside but he missed the ball as it turned away from him and was stumped for 0.
Kagiso Rabada caused significant problems in a superb new-ball spell. He found Abdullah Shafique's edge three times but the ball went for four on each occasion and also beat Shan Masood with a peach that just missed off stump. The pressure Rabada created brought rewards at the other end. Harmer got a second when Masood was stuck on the back foot trying to cut a delivery that angled in and hit on the pad. Babar Azam survived an lbw review before lunch off Rabada when he was hit high on the back leg and Markram was convinced to send it upstairs. The ball would have bounced over the stumps.
Babar continued to live dangerously after the break. He top-edged a sweep off Harmer but it went over leg slip. Shafique hit Muthusamy high over mid-off but Wiaan Mulder couldn't take the catch over his left shoulder. Eventually, Babar settled down and was willing to show a little more patience than his peers.
He scored just nine runs off the first 26 balls he faced and was getting his eye in when he watched Shafique hand Muthusamy a thigh-high caught and bowled dismissal. In Muthusamy's next over, Babar came down the pitch to hit him through mid-on and assert his authority.
Saud Shakeel, on a pair, survived a South African review for lbw off Muthusamy as UltraEdge picked up an under-edge but had to wait seven balls before he scored. He swept Muthusamy behind square for his first runs of the match. Pakistan grew more aggressive as Babar hit Muthusamy over his head, past midwicket and through third for a trio of boundaries in the same over to enter the forties.
The adoring home crowd were denied a Babar fifty when Rabada got one to nip back into him and hit his back pad. He was given out lbw and reviewed, unsuccessfully. Then, just before tea, Shakeel tried to clear midwicket but hit the ball to Tristan Stubbs at deep square leg to leave Pakistan 150 for 5.
Things happened quickly after the break as Pakistan lost their next five wickets for 17 runs in an overall collapse of 7 for 48 from Babar's dismissal. Mohammad Rizwan was bowled by Harmer, who ripped one in between the bat-pad gap. Afridi was promoted to No. 8 and reverse-swept Muthusamy to backward point and then Muthusamy picked up his tenth when he bowled Agha with a tossed-up delivery that beat his swipe.
Any delight South Africa took from a strong bowling performance was soon eclipsed by the dread of how their own line-up would fare in the second innings. Noman soon provided the answer. Markram, frustrated with his 3 off 10, cleared his front leg to try and hoick Noman leg side but missed and was bowled. Then, Mulder, for the second time in the game, played a poor stroke, albeit that this was more of a non-shot. He shaped to cut, backed out and edged Noman to slip and Agha's safe hands made no mistake.
Ryan Rickelton and de Zorzi saw out the day but not without some nervy moments. Rickelton was on 26 when he jabbed Noman to Shafique at short leg but the ball was hit quickly and Shafique could not hold on. De Zorzi survived an lbw shout in the penultimate over after he moved well outside off stump and Pakistan considered reviewing against Rickelton off the last ball but he too had made sure to get outside the line of the stumps.