Wales secured a World Cup quarter-final clash against France next Sunday – but they ended their Pool D campaign with an unconvincing 35-13 victory over Uruguay.
The Six Nations champions fielded only three of their probable last-eight starting XV – wing Josh Adams, centre Hadleigh Parkes and flanker Justin Tipuric.
But that could not excuse an often laboured, error-strewn display in Kumamoto as Uruguay – shock conquerors of Fiji last month – gave Wales a real battle.
Wales led by only a point at half-time following prop Nicky Smith's try that full-back Leigh Halfpenny converted.
Adams then claimed his fifth touchdown of the tournament, with Halfpenny again adding the extras, but Uruguay stayed in touch through two Felipe Berchesi penalties.
Unbeaten Wales finished top of their group with a best pool-phase performance since the 1987 World Cup, yet their latest success will not live long in the memory.
A 65th-minute penalty try took them further ahead, and although Berchesi converted hooker German Kessler's touchdown, Wales added further scores in the final seven minutes from Tomos Williams and Gareth Davies, both converted by Halfpenny.
Tipuric captained a much-changed Wales team, with head coach Warren Gatland making 13 switches from the side that beat Fiji four days ago.
It meant first starts of the tournament for players like wing Hallam Amos, hooker Ryan Elias and lock Adam Beard as Wales looked to keep their winning World Cup run going.
A minute's silence was observed before the anthems as a show of solidarity with everyone affected by Typhoon Hagibis.
When the game started, Wales showed plenty of attacking intent, with Tipuric and wing Adams prominent.
Flanker Aaron Shingler almost went over in the corner for a try, but Uruguay were struggling to cope with mounting pressure, and Smith claimed a 17th-minute touchdown that Halfpenny converted.
Wales did not have it all their own way as Uruguay combined some strong defence with attacking ambition, and fly-half Berchesi opened their account by kicking a 22nd-minute penalty.
Wales should have scored a second try shortly afterwards when Amos breached Uruguay's defence, but it was disallowed following a forward pass by Parkes.
It was poor play by Parkes, and Wales could not establish any rhythm to their game, leading by just four points entering the final 10 minutes of a forgettable first-half.
Uruguay ended the first 40 minutes deep inside Wales territory, and Berchesi kicked a second penalty, making it 7-6 at the break.
Wales had wasted a number of attacking opportunities, and they could have few complaints at the scoreline.
Halfpenny hit the post with a long-range penalty attempt, but Wales increased their lead after 46 minutes.
Sustained pressure ended with Adams claiming his fifth touchdown of the tournament, and Halfpenny's conversion opened up an eight-point lead.
It was better from Wales, but they still found it difficult cracking a spirited and organised Uruguay team.
Uruguay flanker Santiago Civetta was sin-binned for a technical offence 15 minutes from time, and Wales were awarded a penalty try shortly afterwards by referee Angus Gardner.
Although Uruguay claimed a deserved touchdown from Kessler that Berchesi converted, Wales secured a bonus point when Williams darted over, with Halfpenny converting.
And Davies administered the final blow to Uruguay when left several defenders trailing in his wake on a scorching run to the line.