Wales are into the final of the IRB Junior World Championship after beating South Africa with Sam Davies' last-minute conversion of Ashley Evans' try.
Fly half Davies gave Wales a 6-0 lead with two penalties, but a try by Irné Herbst converted by Handré Pollard edged the baby Boks ahead.
Captain Ellis Jenkins' try put Wales ahead, but South Africa hit back with Kwagga Smith's try, Pollard converting.
The centre's 75th minute penalty seemed to seal the win, but Wales hit back.
A superb break by fullback Jordan Williams put Wales onto the attack with time running out, and Sam Davies' perfect chip was caught by Evans who crossed wide out.
Davies' nerveless conversion clinched a thrilling 18-17 victory for Wales, who will face England in Sunday's final.
Six Nations champions England beat New Zealand 33-21 in the second semi final.
South Africa Under-20: Cheslin Kolbe (DHL Western Province), Luther Obi (Platinum Leopard), Dries Swanepoel (Vodacom Blue Bulls), Handré Pollard (Vodacom Blue Bulls), Seabelo Senatla (SARU contracted), Robert du Preez (The Sharks), Stefan Ungerer (The Sharks), Ruan Steenkamp (captain, Vodacom Blue Bulls), Jacques du Plessis (Vodacom Blue Bulls), Roelof Smit (Vodacom Blue Bulls), Dennis Visser (Vodacom Blue Bulls), Irné Herbst (Vodacom Blue Bulls), Luan de Bruin (Toyota Free State Cheetahs), Jacques du Toit (Toyota Free State Cheetahs), Andrew Beerwinkel (Vodacom Blue Bulls).
Replacements: Michael Willemse (DHL Western Province), St Sithole (DHL Western Province), Aidon Davis (EP Kings), Kwagga Smith (MTN Golden Lions), Percy Williams (MTN Golden Lions), Justin Geduld (SARU contracted), Jesse Kriel (Vodacom Blue Bulls), Marné Coetzee (The Sharks).
Wales Under-20: Jordan Williams (Scarlets / Llanelli); Ashley Evans (Ospreys/ Bridgend), Steffan Hughes (Scarlets / Llanelli), Jack Dixon (Dragons), Hallam Amos (Dragons/ Newport); Sam Davies (Ospreys / Swansea), Rhodri Williams (Scarlets/ Llandovery); Gareth Thomas (Scarlets/ Carmarthen Quins), Ethan Lewis (Blues / Cardiff), Nicky Thomas (Ospreys / Swansea), Jack Jones (Ospreys / Rovigo), Rhodri Hughes (Ospreys/ Swansea), Sion Bennett (Scarlets/ Carmarthen), Ellis Jenkins (capt, Blues / Cardiff), Ieuan Jones (Dragons/ Newport).
Replacements: Elliot Dee (Dragons / Bedwas), Thomas Davies (Blues /Cardiff), Dan Suter (Ospreys/ Bridgend), James Benjamin (Dragons / Bedwas), Daniel Thomas (Scarlets/ Llanelli), Joshua Davies (Dragons / Bedwas), Aaron Warren (Llandovery), Thomas Pascoe (Blues / Pontypridd).