South Africa have beaten Wales and will join England in the Rugby World Cup.
The final score was 19-16 to the Sringboks in a game devoid of showmanship.
The South Africans will be bidding to win the trophy for a third time, after their victories in 1995 and 2007.
England are trying for a second triumph after winning in 2003.
The dour match in Yokohama, Japan, was dominated by defences and stayed level at 9-9 in the second half before finally coming to life.
Damian de Allende crossed for the first try of the match after 57 minutes and Handre Pollard’s fourth successful kick of the match left Wales trailing by seven points.
But Welsh wing Josh Adams responded with a try, converted by Leigh Halfpenny to leave the teams tied at 16-all.
The deadlock was only broken in the last five minutes when South Africa’s Handre Pollard kicked the winning penalty to break Welsh hearts and extend their wait for a place in the biggest match in the sport.
Wales captain Alun Wyn Jones congratulated South Africa but praised his team for “staying in the arm-wrestle”, while admitting “today we fell short”.
Wales coach Warren Gatland, who retires after the third-place play-off against New Zealand, told ITV1 he was “proud of our guys”, but admitted they “gave away too many penalties”.
He wished the victorious Boks well, predicting “a great final between South Africa and England”.
The Duke and Duchess of Cambridge were quick to console the Welsh, tweeting in praise of their “heroic” performance and Jones’ “brilliant leadership”.
Labour leader Jeremy Corbyn was the first of the main party leaders to follow suit, tweeting that it was a “heartbreaking” defeat for the Welsh, who’ve “done themselves proud”.
South Africa’s president, Cyril Ramaphosa had a message for Boris Johnson, or “BoJo”, telling the prime minister he will “see you on Saturday” and predicting his side will take the trophy.
News reporter @SkyRussHope1 South Africa have beaten Wales and will join England in the Rugby World Cup. The final score was 19-16 to the Sringboks in a game devoid of showmanship. The South Africans will be bidding to win the trophy for a third time, after their victories in 1995 and 2007.