Birmingham: Pakistan put their miserable hammering by arch-rivals India behind them with a shock 19-run win over South Africa at Edgbaston on Wednesday that kept their Champions Trophy semifinal hopes alive.
Just three days after suffering a humiliating 124-run defeat by title-holders India at Edgbaston in their opening group match, with former skipper Shahid Afridi among those slamming a "clueless" display, Pakistan's return to the Birmingham ground saw them make a mockery of the rankings which had them bottom and South Africa top in this eight-team one-day international tournament.
Having conceded 319 for three against title-holders India, Pakistan restricted South Africa to 219 for eight after losing the toss.
After the spinners did the initial damage, paceman Hasan Ali took three for 24 in eight overs.
David Miller's unbeaten 75 kept the Proteas in the game.
And when fast bowler Morne Morkel took two wickets in three balls, Pakistan were faltering at 41 for two under the floodlights in this day/night fixture.
But Babar Azam (31 not out) and Shoaib Malik (16 not out) took Pakistan to 119 for three off 27 overs when heavy rain stopped play at 7:41pm.
That left them well ahead of their target score of 101 so that when the umpires finally decided more than two hours later that a resumption was impossible, Pakistan had beaten South Africa under the Duckworth/Lewis method for the second successive ICC 50-over tournament following a 29-run win at the 2015 World Cup.
It left Group B wide open, with three teams on a win apiece after South Africa defeated Sri Lanka by 96 runs at the Oval last week.
"It's a very important win for us," said Pakistan captain Sarfraz Ahmed.
"We were good in all departments today.
"Steve Rixon (the Pakistan fielding coach) was very happy today, we didn't field well the other day, today we were much better."
Hasan, the man-of-the-match, added: "We all worked very hard on our fielding."
South Africa captain AB de Villiers, who suffered the first golden duck in his 212 career ODI innings during the Proteas' top-order collapse, said: "They bowled pretty well, put us under pressure."
De Villiers, struggling with a hamstring problem, added: "The hamstring is okay, felt a little tweak, but we'll check it out tomorrow (Thursday). I don't think it's too serious."
Pakistan's Mohammad Amir and Junaid Khan, in for the injured Wahab Riaz, took the new ball.
But it was the spin duo of Imad Wasim and Mohammad Hafeez who did the early damage.
Left-armer Imad struck second ball when Hasim Amla (16) was lbw.
Off-spinner Hafeez then had Quinton de Kock (33) lbw on the sweep.
The two spinners combined when de Villiers departed by slicing Imad to Hafeez at backward point -- a wicket greeted by huge cheers from the large Pakistan contingent in a crowd of more than 18,000.
Hasan, as Imad had done, struck second ball when Faf du Plessis (26) played on.
He then took two wickets in two balls with a couple of brilliant deliveries to reduce South Africa to 118 for six in the 29th over.
He took the outside edge of JP Duminy's bat, with Babar holding a good diving slip catch, and then knocked over Wayne Parnell's off-stump.
Miller, however, received good support from Chris Morris (28) and Kagiso Rabada (26) in stands of 47 and 48 respectively.
Pakistan's collapse to 164 all out against India would have given South Africa hope, despite their below par total.
But Fakhar Zaman, making an ODI debut in place of the dropped Ahmed Shehzad, got Pakistan's chase off to a brisk start.
The left-hander eventually fell for 33 when, deceived by Morkel's slower ball, he edged to Amla at slip.
Two balls later, Azhar Ali (nine) carelessly uppercut Morkel to Pakistan-born leg-spinner Imran Tahir, who took three for 18 in seven overs.
Tahir took another good catch, at long leg to dismiss Hafeez (26) off an uppish pull against Morkel.
South Africa 219-8, 50 overs (D Miller 75 no; Hasan Ali 3-24)
Pakistan 119-3, 27 overs (M Morkel 3-18)
Pakistan won by 18 runs (DLS)