Scrappy Wales were made to work hard for victory against Uruguay, but prevailed with a bonus-point 35-13 win in Kumamoto on Sunday to top Pool D and set up a quarter-final with three-time finalists France.
Wales clung to an eight-point lead with seven minutes left, until a strong carry by Leigh Halfpenny scattered the Uruguayan defence and opened up a hole for Tomos Williams to settle the matter with the bonus-point try.
Coach Warren Gatland was a picture of discontent for much of the evening, as his team were denied four tries, including two from forward passes.
The Welsh win ensures Australia will play England in another quarter-final with England.
A moment of silence was held before the game for victims of Typhoon Hagibis, which pounded into Japan's main island of Honshu on Saturday.
Wales 35 (Josh Adams, Gareth Davies, Nicky Smith, Tomos Williams tries; penalty try; Leigh Halfpenny 4 conversions) Uruguay 13 (German Kessler try; Felipe Berchesi conversion & 2 penalties)
Join us for live updates of all Rugby World Cup quarter-finals next weekend.