A 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 World Cup quarter-final with three-times 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 said Wales were "poor at times" but added that he was happy to come through the game without further injuries, and expected to have a full squad to choose from against France.
"Hopefully everyone will be fit and available for next week. Nothing looks serious from tonight," he said.
"We had a couple of guys who were pretty sore after the Fiji game – two or three of them – but they should be back training in a couple of days so we should have a full complement to be able to choose from."
Wales also scored tries from Nicky Smith, Josh Adams, Gareth Davies and a penalty try but Gatland was a picture of discontent for much of the evening.
His team were denied four tries, including two from forward passes, and committed a string of handling errors on a perfect night for rugby.
"We know we have to do a lot better than that. But we have to be happy that we came away with a bonus-point win," said flanker Justin Tipuric, who led the side for the first time in place of regular rested skipper Alun Wyn Jones.
"You have to give Uruguay credit. They didn't stop from the beginning to the end and they're a tough bunch of boys."
Uruguay bowed out of the World Cup with huge satisfaction having earned plenty of respect from tier-one nations and also upset Pacific power Fiji earlier in the tournament.
"There were areas where we were able to play how we wanted and we were also able to shock Wales," said coach Esteban Meneses.
"We were able to show how we have developed Uruguayan rugby."
The Welsh had come into match with 13 changes and a patched-up backline with Dan Biggar sidelined after his second head knock of the tournament.
A moment of silence was held before the game for victims of Typhoon Hagibis, which hit Japan's main island of Honshu on Saturday.