Kagiso Rabada took a hat-trick in the final over to consign England to their first defeat of the T20 World Cup, on a night when neither the winners or losers will have gone home happy.
South Africa finished with a 10-run win at Sharjah Cricket Stadium. It was not enough for them to vault above Australia, who had thrashed West Indies earlier in the day, in the points table, and so they will exit the competition.
England had done enough to ensure they went through at the top of the group, and can now look forward to a semi-final in Abu Dhabi on Wednesday against one of New Zealand, Afghanistan or India.
The fact their winning streak was broken was not their lone concern, though. They are also now sweating on the availability of Jason Roy for the remainder of the competition.
Before the start of play South Africa knew they needed to win by around 60 runs if they were to beat Australia to the second qualifying place from the group.
That would be no easy task against arguably the most impressive side in the competition to date, and on a Sharjah track where runs have proved difficult to come by.
Their batters gave them a chance, though, most notably Rassie van der Dussen. The 32-year old had been inconspicuous in the competition before this point, despite having hit a century in the last warm-up match against Pakistan.
He almost repeated the feat in their last Super 12 match, but fell just short. Van der Dussen ended 94 not out off 60 balls.
His partner at the end of the innings, Aiden Markram, clubbed the second fastest 50 of the tournament so far, from just 24 balls, as the Proteas reached 189-2.
At that point, there were three permutations which mattered. England required 87 runs to qualify for the last four. They needed 106 to top the group, while South Africa needed to restrict them to 130 if they were to go with England to the next phase.
Yet again, England lost a key player to injury in a match in Sharjah. Roy started the chase off in confident fashion, reaching 20 off 15 balls.
At that point, he was called through for a regulation single by his opening partner Jos Buttler, only to pull up lame on his second stride.
Roy was vividly pained by what appeared to be a calf injury. He had already suffered once in the game. At the end of the South Africa innings he had clattered into the electronic display advertising board surrounding the ground while attempting to stop a six.
He was treated at the wicket, then had to be carried off.
It is unclear as yet what the prognosis is, but it did not look good.
England had already lost Tymal Mills to a soft-tissue injury before this game. The fast bowler strained a thigh muscle in the game against Sri Lanka, also in Sharjah.
The team’s stocks were already depleted even before they arrived in the UAE for this tournament, with Jofra Archer, Ben Stokes and Sam Curran all unavailable for the trip.
Roy’s exit took the edge off England’s chase, and they were flagging when they needed 65 off the last five overs.
At that point their spirits were revived by an extraordinarily brutal salvo from Liam Livingston.
The Lancashire batter had only been to the wicket once in four matches so far in the tournament, and that was only a brief stay, as he made one while England chased 55 against West Indies.
Despite the lack of practice, he drilled successive balls out of the stadium and into the football ground next door, then the next one into the sightscreen.
That assault must have left Rabada nervy when he was left to defend 14 off the last over.
Chris Woakes, Eoin Morgan and Chris Jordan all managed to find fielders off the first three balls, though, and England ultimately fell short.