The Baby Boks suffered the heartbreak of conceding a last-minute try to be edged out of the Junior World Championships by Wales.
Inspired by talented back Jordan Williams, Wales produced a stunning fightback with time running out to send South Africa home.
South Africa had twice come from behind to hold the lead in the final quarter and looked on course for a place in Sunday's final and a chance to retain the world crown they won in Cape Town a year ago.
Lock forward Irne Herbst collected a short throw at the front of the lineout to crash over for the first try and give South Africa a 7-6 lead on the half hour. Then, replacement flank Kwagga Smith, reclaimed the lead for South Africa with the second try on the hour to make it 14-11.
Handré Pollard had converted both tries and added a penalty to give South Africa a 17-11 lead with five minutes remaining.
However, Wales right wing Ashley Evans dived on flyhalf Sam Davies' chip into the in goal area and Davies then converted from wide out on the right to give Wales a last-gasp victory and send them through to the final where they will face either England or New Zealand.
Wales captain Ellis Jenkins: "Unbelievable, it is a bit surreal at the moment. That was tense. we knew it would take something special to break the defense and Sam has dropped that kick on the money for Ash to go over in the corner and then stepped up, nerves of steel and slotted it from the touchline. But I thought our front row were outstanding, and our front five. Absolutely outstanding.
"Everything hurts, but we played a very good game of rugby. We had our chances and we knew if we stuck to our game plan we would score tries and we did, just in the nick of time. All the talk before the game was about their back three, but I think our back three has been outstanding. It is just a really good feeling when it comes together like that."
Wales fly half and match-winner Sam Davies: "It was getting hard towards the end of the game and we were running out of options. Their 15 came into the line to make the tackle, there is no one behind and I have seen the space, dropped it into the corner for our winger who has seen that space, to finish it off. I have missed more than I have kicked in my time so it is nice to get that one over to seal that victory.
"We are over the moon, we have made history in our country, and we move on to the final and look for another big win there. It is huge, we had a lot of talk about making history, getting to that semi, and then progressing on as we have done today. No other Welsh team at Under 20 level has done that and we are really proud of ourselves."
South Africa coach Dawie Theron: "We had our opportunities in the game - I think there was at least two tries that we could have scored. I think maybe the guys were a little bit anxious in the moment. And, I must lift my hat to the Welsh. They really stuck to their kicking game - they had a very, very well prepared kicking game. They kept us in the corners, we couldn't get out of our half. In the end, the bounce of the ball made the difference.
"Nobody can accuse them of a lack of effort. The guys really played well. We tend to forget that this is age group competitions - it's the crop of the year. Like I said to the boys downstairs, you need a little bit of luck sometimes. The luck, with the bounce of the ball, went with the Welsh today and the next time it'll go to us. We're definitely not happy about losing, but we can keep our head high. And we're going to work for the next game."