Wales' World Cup dream ended in Yokohama as they made another painful semi-final exit after losing 19-16 to South Africa.
The Springboks will face England in next Saturday's final following fly-half Handre Pollard's match-winning penalty four minutes from time.
Pollard kicked 14 points and centre Damian de Allende scored a try, with their opponents replying through wing Josh Adams' Wales record-equalling sixth try in one World Cup, three Dan Biggar penalties and a Leigh Halfpenny conversion.
For Wales, who were semi-final casualties against France eight years ago when captain Sam Warburton was sent off, it proved an agonising experience.
Their hopes of confirming a first all-northern hemisphere Rugby World Cup final were dashed and they also lost wing George North and prop Tomas Francis to first-half injuries.
Wales now play New Zealand in the third and fourth place play-off. It will be head coach Warren Gatland's final game at the helm before he steps down after 12 years.
England and South Africa, though, will contest a second final 12 years after the last one that the Springboks narrowly clinched.
Halfpenny was among three changes made by Gatland, replacing ankle-injury victim Liam Williams, while number eight Ross Moriarty took over from Josh Navidi and fit-again centre Jonathan Davies returned for Owen Watkin.
South Africa were without injured wing Cheslin Kolbe, so S'bu Nikosi deputised and Springboks scrum-half Faf de Klerk made an immediate contribution through a kick and chase into Wales' 22, but North cleared the danger and Wales moved confidently up field.
Both teams readily resorted to tactical kicking, but Wales looked to have a more creative spark about them, with scrum-half Gareth Davies prominent as he marked reaching 50 caps.
The opening 10 minutes, though, were a considerable notch down in terms of pace and intensity on England's semi-final against New Zealand.
South Africa looked to attack off first-phase ball as De Klerk pulled the strings and his half-back partner Pollard kicked the Springboks ahead through a 15th-minute penalty.
But that score was cancelled out three minutes later when Biggar found the target with a wide-angled penalty, only for Wales to concede a scrum penalty in a game dominated by set-pieces, and Pollard stepped up to make it 6-3.
England head coach Eddie Jones and his defence specialist John Mitchell watched from the stands as both sides struggled to find any pattern or rhythm.
There was precious little ambition either, with boot to ball being the dominant and predictable approach.
Wales needed to get some width on their game and stretch a Springboks outfit seemingly intent on a no-frills approach, despite De Klerk's verve, but Pollard's reliable boot then put them six points clear.
It was a dismal end to the first-half for Wales, despite Biggar kicking a second penalty, as Francis and North departed the action in rapid succession.
Biggar gave Wales just the start they needed to the second period, kicking them level with a third penalty.
With the stakes so high, there appeared little chance of the game opening up, and it was 9-9 with 30 minutes left.
Tries by De Allende and Adams - both converted - meant the game appeared to be heading towards extra-time.
Adams' score matched the Wales best for one World Cup tournament set by Shane Williams, but South Africa had just enough in the attack to shade an attritional encounter.
In the end, in came down to Pollard keeping his nerve as South Africa inched to the final and crestfallen Wales were left to reflect on what might have been.