South Africa 189 for 2 (van der Dussen 94*, Markram 52*) beat England 179 for 8 (Moeen 37, Malan 33, Rabada 3-48) won by 10 runs
Sharjah: England qualified for the semi-finals of the Men's T20 World Cup despite an entertaining 10-run defeat by South Africa in Sharjah.
Chasing 190, England needed 14 from the final six balls but Kagiso Rabada began the over with a hat-trick, having Chris Woakes, Eoin Morgan and Chris Jordan caught in the deep.
Although they inflicted a first defeat of the tournament on England, South Africa's failure to limit them to 131 or fewer meant Australia reached the last four at the Proteas' expense.
Significantly, England lost opener Jason Roy to what appeared to be a serious calf injury.
He looked close to tears when forced to retire hurt on 20 and was seen on crutches after the game.
In a game full of wonderful striking, Rassie van der Dussen made a brilliant 94 not out from 60 balls in South Africa's 189-2, sharing an unbroken 103-run stand with Aiden Markram, who scored 52 not out from 25 deliveries.
Australia's win over West Indies earlier in the day meant South Africa knew they needed a win, and a big one, to finish in the top two.
The 189-run total, inspired by Van der Dussen and Aiden Markram’s rapid 52 off 25, meant the Proteas had to restrict England to less than 131 in the second innings.
And although they did deny England the win thanks to a terrific spell from Tabraiz Shamsi and a final-over hat-trick from Rabada, they were unable to win by enough to seal second spot in the group.
Earlier, South Africa’s top order had put England to the sword with a stunning batting display to post 189/2.
England’s Moeen Ali has a terrific career record against South African dangerman Quinton de Kock, so it was little surprise to see the all-rounder take the new ball.
But what was slightly more surprising was Ali bowling out his full four overs straight out of the gate.
It is only the second time in T20 cricket that Ali has done so, the first being against West Indies earlier in this tournament.
The spinner finished with tidy figures of 1/27 as his steady tournament with the ball continued.
And it was opener Reeza Hendricks who was the wicket to fall, with the flight luring him into a big sweep shot that failed to connect, the ball cleaning up middle stump.
The 32-year-old van der Dussen took over after de Kock was caught by Jason Roy off Adil Rashid for 34 from 27 in the 12th over.
He was joined in the middle by Markram, who scored at a strike rate of over 200 in his outstanding half-century – the second fastest of the tournament after KL Rahul.