Cecil Afrika proved in Dubai last week that he is one of the South African team's most potent weapons and continued to do so as the speedster ran in three tries to see his side to victory.
His most important of the three tries came minutes after the full-time siren sounded and brought the local crowd to their feet when all hope appeared to be lost.
As has become the tradition when the Sevens Boks play, Afrika was first to score and he also had the last say when he converted the match winning five-pointer.
Wales opened their scoring though Tom Isaacs and snatched the lead from the hosts when Rys Jones slotted the conversion.
Afrika's second try gave the Boks a slim 10-7 lead at halftime as Wales started showing that the wet conditions may count in their favour.
One of the key moments in the match was the try scored by Boks skipper Kyle Brown with less than three minutes left to play.
Wales, however, were not about to give up and tested the South African defence to it's limits.
Despite a brilliant try-saving tackle by Paul Delport, the visitors added five more points as Aaron Shingler capitalised after the Boks lost a crucial lineout on their own try line.
Again the lead changed hands and, at that stage, it looked almost certain that the semifinal could be the last match the Springboks would play in the competition.
Gareth Davies then took his time in converting the try, but a poor kick-off ensured the Boks had one last chance to bag the win.
The Springboks next face Argentina – whom they beat 29-5 in a pool match on Friday – in the plate final.
Scorers:South Africa 24 (10): Tries - Cecil Afrika (3), Kyle Brown. Conversions – Afrika (2).
Wales 21 (7): Tries - Tom Isaacs, Richard Pugh, Aaron Shingler. Conversions - Rhys Jones (2), Gareth Davies.