Pakistan beat South Africa by 49 runs to end the Proteas' World Cup dream and rekindle their own tournament hopes at Lord's on Sunday.
Haris Sohail (89) top-scored for Pakistan, who reached 308 for seven in their 50 overs before restricting the out-of-form South Africa to 259-9.
South Africa cannot now mathematically qualify for the semi-finals from the 10-team round-robin phase but Pakistan still have a slender chance of reaching the last four.
Sohail was making just his second appearance at this year's World Cup and his dashing display at Lord's suggested he should have been involved more often.
The 30-year-old, dropped following Pakistan's opener against the West Indies, made up for lost time as he demolished South Africa's beleaguered bowlers.
Hitting nine fours and three sixes in his 59-ball blitz, Sohail gave Pakistan a shot of adrenaline after Babar Azam's more sedate 69 laid the foundations.
Spectators cheer during the 2019 Cricket World Cup group stage match between Pakistan and South Africa. AFP
With only one win apiece, Pakistan and South Africa both need a victory to keep alive their slender hopes of qualifying for the semi-finals via a top-four finish in the 10-team group stage.
Beaten by bitter rivals India in their last match, Pakistan's players spent the past week involved in a series of spats with frustrated fans both in person and on social media.
After Pakistan captain Sarfaraz Ahmed won the toss and decided to bat first, Fakhar Zaman and Imam-ul-Haq lifted morale with a stand of 81 for the first wicket
Spectators cheer during the 2019 Cricket World Cup group stage match between Pakistan and South Africa. AFP
Zaman slapped Kagiso Rabada's second ball of the match through the covers for a tone-setting four.
The green-shirt-clad Pakistan fans who made up the majority of the crowd were on their feet cheering when Zaman's effortless six off Lungi Ngidi made it 44-0 from the first six overs.
Zaman had a narrow escape when he slogged Chris Morris to Imran Tahir, who claimed he made the catch after running in from the boundary.
The umpires asked for a review that showed the Pakistan-born South African's fingers were not under the ball as it hit the turf.
Tahir was booed by Pakistan fans when he came on to bowl, but the leg-spinner got his revenge when Zaman attempted a bizarre scooped shot that saw him caught in the slips by Hashim Amla on 44.
Not surprisingly, Tahir's trademark celebration sprint around the pitch seemed a little more vigorous than usual.
Tahir was just getting warmed up and he produced a sublime catch off his own bowling to dismiss Imam for 44.
Lunging low to pluck the ball just before it hit the ground, Tahir was ecstatic as he blew kisses to his detractors in the crowd.
Tahir's 39th World Cup scalp made him South Africa's all-time leading wicket-taker in the tournament.
Mohammad Hafeez departed for 20, lbw to Aiden Markram, to leave Pakistan 143-3 in the 30th over.
That brought Sohail to the crease and his aggression, including a four and a six from successive Rabada deliveries, restored Pakistan's momentum.
Babar stepped on the gas as he went past 50, but he holed out to Ngidi on the boundary off Andile Phehlukwayo to end an 80-ball innings featuring seven fours.
Sohail smashed a four to reach his 50 in 38 balls and saw Pakistan through to the last over before mistiming a pull off Ngidi.
Agence France-Presse