Mohammad Haris was parachuted into the Pakistan XI after Fakhar Zaman suffered a tournament-ending recurrence of the knee injury that he has struggled with this year, and he made an immediate impact. He was hit on the grille the second ball he faced - a Wayne Parnell short ball - and that seemed to spark him into action. He tucked into Kagiso Rabada's opening over, and sent a half-volley over deep backward square for six, then a pull over fine leg for six more before creaming another short ball through square leg to cost South Africa their most expensive over of the tournament so far: 17 runs.
Iftikhar Ahmed and Mohammad Nawaz helped Pakistan recover from 43 for 4 with a 52-run fifth-wicket stand. They had some nervy moments up front, when Iftikhar gloved the ball skywards, to Quinton de Kock's right. De Kock made a valiant one-handed effort and could not hold on. Two balls later, Nawaz got a thick edge wide of de Kock, but the pair didn't look back from there.
Nawaz's dismissal brought Shadab Khan to the crease and Pakistan could not have asked for anything more. Shadab took a liking to Shamsi and scored 13 runs off his final over, which cost 15 in total, before launching an Ngidi full-toss to deep backward square for four, driving Nortje through mid-off for four more and uppercutting him for six. Nortje chose to bowl full at the end and got an attempted yorker wrong. Shadab sent the full-toss into the stands and then another over long-on, to bring up fifty off 20 balls - Pakistan's second-fastest fifty in T20I cricket. He put Pakistan in touching distance of 200 but then went big once too many times, was dropped by Aiden Markram at long-on and then caught by Tristan Stubbs at deep midwicket.
Shadab's dismissal set in motion an intense end to the innings in which Pakistan lost four wickets for eight runs as Pakistan tried to breach the boundary with every ball. Mohammad Wasim top-edged Nortje and Bavuma zooted in from the ring to take a running catch. In the last over, Iftikhar opted to take on Rabada and hit him to long-on where Rilee Rossouw took a superb catch. And Haris Rauf was run-out off the last ball, as Pakistan scrambled to run a fourth. Bavuma was the man who broke the stumps.
Pakistan's ace had a quiet start to the tournament, with just one wicket from the first three matches, and explained he was working his way to a full head of steam after returning from injury. He got there in this match, when he started with a series of back-of-a-length deliveries to de Kock, who was eyeing the midwicket area but not finding it. De Kock got there off the last ball of the over, but toe-ended his effort to Haris on the edge of the ring. De Kock was dismissed for a duck. In his next over, Afridi pulled in South Africa's big fish, Rossouw, with a ball that did not deserve a wicket. It was short, wide and screamed "hit me", and Rossouw obliged. He slashed to deep third where Naseem Shah ran around to take the catch. South Africa were 16 for 2.
Bavuma played his most pleasing and profitable innings of 2022, and scored 36 off 18 balls (which included a scoop for six, which he tried and failed to pull off earlier in the tournament) and the hoodoo seemed to be broken. But Shadab continued to own the night when he was brought on in the eighth over. He delivered a stock-standard legbreak, Bavuma opened the face of the bat to try and hit to third, and nicked off. This strike was crucial, because with rain looming, it put South Africa behind on DLS. After 7.1 overs, at two down, the DLS par was 59. With three down, it jumped to 66. South Africa were on 65 at the time. And it got worse for them. Two balls later, Shadab bowled Markram with a topspinner, as the batter went back to try and cut, and South Africa were 66 for 4. The teams were taken off nine balls later, and it was clear that Shadab had had a decisive hand in this match.
Firdose Moonda is ESPNcricinfo's South Africa correspondent