Shadab Khan starred with bat and ball as Pakistan kept their hopes of reaching the T20 World Cup semi-finals alive with a 33-run Duckworth-Lewis-Stern win over South Africa.
Pakistan needed a victory at the Sydney Cricket Ground on Thursday to have any chance of qualifying, and they recovered from a poor start to come out on top after posting 185-9 in a rain-affected match.
Shadab (52 from 22 balls) struck the second-fastest T20I half-century for Pakistan, putting on 82 for the sixth wicket with Iftikhar Ahmed (51 off 35) in just under six overs after Babar Azam's side had at one point been reduced to 43-4.
Dropped catches cost the Proteas as rain started to fall in Sydney, where Anrich Nortje took 4-41, and they were 16-2 early in the run chase after the excellent Shaheen Shah Afridi removed Quinton de Kock and Rilee Rossouw.
Shadab came to the fore again by dismissing Temba Bavuma (36 from 19) and Aiden Markram (19 off 14) in his first over, with South Africa 69-4 off nine overs when rain stopped play.
The Proteas, without the injured David Miller due to back spasms, needed 73 more runs from 30 balls to maintain their unbeaten record when play resumed, but wickets tumbled as they were restricted to 108-9.
Pakistan move up to third in Group 2, a point behind South Africa and two adrift of leaders India with one game to play in the Super 12 stage.
The Proteas face Netherlands at Adelaide Oval on Sunday, with Pakistan taking on Bangladesh at the same venue and India up against Zimbabwe.
Shadab and Iftikhar to the rescue
Pakistan were in trouble on 95-5 when Shadab joined Iftikhar out in the middle, and that pair came to the rescue with an incredible onslaught.
Shadab reached the half-century mark from only 20 balls by launching four sixes and hitting three fours in a swashbuckling knock. Only six batters have got to a fifty quicker in men's T20 World Cup history.
Iftikhar cleared the rope on two occasions and hit another three boundaries, with the Proteas also giving Pakistan a helping hand in the field even before drizzle made life difficult for the fielders.
Afridi shows his class, double blow from Shadab
Left-arm paceman Afridi was magnificent with the new ball, getting the dangerous De Kock caught in the ring and Rossouw taken in the deep.
He claimed 3-14 from three top-quality overs, having also seen the back of Heinrich Klaasen following the break for rain.
Shadab (2-16) also made a huge impact with the ball, trapping Bavuma leg before with his third ball and bowling Markram with his third as Pakistan made it four T20 World Cup wins from four against South Africa.