Pacer Kagiso Rabada claimed a hat-trick in the final over as South Africa defeated tournament favourites England by 10 runs in Sharjah on Sunday.
After being asked to bat first by England skipper, South Africa lost Reeza Handricks early to Moeen Ali for 2.
Quinton De Kock and Rassie Van der Dussen added 71 runs for the second wicket before the former mistimed a Adil Rashid delivery to Jason Roy at long on for a 27 ball-34.
Van Der Dussen (94* off 60) and Aiden Markram (52* off 25) featured in an unbeaten 103 run stand for the third wicket to take South Africa to 189/2 in their allotted 20 overs.
For England Moeen Ali and Adil Rashid claimed a solitary wicket each.
Chasing 190, Jason Roy and Jos Buttler got England off to a blazing start. The duo added 38 runs before a leg injury forced Roy to retire on 20.
Jos Buttler who was looking dangerous during his short stay, perished to Anrich Nortje for a 15 ball- 26.
Tabraiz Shamsi then got into the act by trapping Jonny Bairstow (1) plumb in front of the stumps.
Dawid Malan along with Moeen Ali stitched together a valuable 51 run stand for the third wicket before the latter was caught at long on by Miller off Shamsi for a quickfire 37.
With 14 required off 6 balls, Rabada, who had earlier been smoked for three wickets by Liam Livingstone, claimed a hat-trick in the final over by dismissing Chris Woakes, skipper Eoin Morgan and Chris Jordan off successive deliveries as England ended up with 179/8, losing the contest by 10 runs.
Despite the victory, the Proteas failed to qualify for the playoffs on net run rate, as England and Australia reached the semifinals from Group 1.