A fired up Pakistan got the better of South Africa by 19 runs via the Duckworth-Lewis method in a rain-hit game to remain in contention for the semi-finals in the ICC Champions Trophy, in Birmingham, on Wednesday.
After an embarrassing defeat against India, Pakistan produced a dominant bowling performance to subdue the Proteas to keep their hopes alive.
Pakistan spinners and pacers bowled their hearts out to restrict South Africa to a modest 219 for eight on a slowish Edgbaston wicket after being asked to bowl.
Pakistan were comfortably placed in their chase at 119 for three in 27 overs when rain interrupted the proceedings. At that stage Pakistan were 19 runs ahead according to the Duckworth-Lewis calculations.
The contest could not be resumed due to persistent drizzling and Pakistan were declared winners of the game.
Pakistan had made a steady start to their chase with Fakhar Zaman (31) and Azhar Ali (9) putting on board 40 runs before Morne Morkel sent back both in space of three balls.
Young batsman Babar Azam though dug his heels and raised a 52-run stand with Mohammaed Hafeez (26) to deny Proteas furher inroads in their innings.
Morkel was at it again as he broke the partnership by getting rid of Hafeez but Malik remained solid to lead Pakistan to a much-needed win.
Seasoned Shoaib Maik (16) then combined well with young Babar Azam (31) to ensure they do suffer no more setback as the duo added 52 runs for the fourth wicket which ensured Pakistan victory.
Earlier, Pakistan bowlers bowled their hearts out after South Africa elected to bat on a slightly slow wicket at Edgbaston.
The spinners choked the Proteas in the beginning with three strikes and later the pacemen pulled the rug from under South Africa's feet with fiery spells.
Had it not been for a fighting knock from David Miller (75 not out) and his timely 47-run stand with Chris Morris (28) for the seventh wicket, the Proteas would have even struggled to get close to the 200-run
Miller also found some good support from Kagiso Rabada, who came up with a 26-run knock as the they added 48 runs for the eighth wicket.
These two partnerships were crucial for South Africa after they were struggling at 118 for six at one stage.
Left-arm spinner Imad Wasim took two wickets upfront while Hasan Ali (3/18) wiped off the middle order in a sensational three-wicket burst that turned the tide in the favour of Pakistan, who need to win this match to stay alive.
Pacers Mohammed Amir and Junaid Khan (2/53) did not take many wickets but peppered the South Africans with well-calculated yorkers to further choke them.
Pakistan spinners proved very effective early in the South African innings with Wasim (2/20) and Mohammed Hafeez (1/51) cleaning up the top-order within the first 15 overs.
Wasim, introduced in the ninth over, struck with his second ball to break the steady opening stand. He trapped consistent Hashim Amla (16) before he dismissed Proteas skipper AB de Villiers for his first ever golden duck in ODIs.
De Villiers flashed hard at one but hit straight to point where Hafeez took a simple catch.
Part-time spinner Mohammed Hafeez accounted for the well-set Quinton de Kock (33), who used his feet very well before attempting a sweep but was caught in front of the wicket.
Faf du Plessis (26) and David Miller had to work hard to keep the scoreboard ticking in the middle oversbut they could not build a big partnership as paceman Hasan Ali dismissed the former with the second ball of his spell.
Du Plessis was bowled off an inside edge to leave South Africa reeling at 90 for four in the 23rd over. Pacer Ali wreaked havoc a few overs later when he sent back JP Duminy (8) and Wayne Parnell (0) off successive deliveries.
'Top class' Ashwin understands why he was dropped, says captain Kohli
Why Kohli thinks Hardik is asset for Indian cricket
Confident India aim to seal semis berth in rain-threatened tie
Why I think Sunny Paaji should retire as commentator
All you want to know about the Champions Trophy