Wales ended their Rugby League World Cup campaign with a third successive defeat as they lost a close game to the Cook Islands at The Gnoll in Neath.
The Cook Islands led 16-4 at half-time and held on in the second half to claim a first World Cup win in six attempts.
Keith Lulia, Isaac John, Daniel Fepuleai, Dominique Peyroux and Jonathon Ford scored their tries.
Rob Massam, Lloyd White, Christiaan Roets (2) and Rhodri Lloyd replied as White and Danny Jones kicked goals.
Both teams went into the game knowing that the United States were already assured of top spot in Group D - and with it a place in the last eight.
And they got off to a poor start in Neath, cheaply squandering possession as their opponents enjoyed several repeat sets.
It was no surprise when Wales fell behind after a powerful charge over the line from hooker Fepuleai before Christopher Taripo added the extras.
Man-of-the-Match, full-back Elliot Kear passed for Rhys Evans to send Massam over as Wales battled back
However, Keith Lulia went over unopposed after a nippy offload by prop Zeb Taia and Penrith Panther John touched down just before the break as the Cooks Islands built a 12-point lead.
Their attacking threat bore fruit after the restart, with Peyroux scoring and Taripo's third conversion leaving Wales 22-4 down.
That score sparked an impressive Wales comeback as White and Roets touched down after the hosts finally managed to build some sustained attacking pressure.
Lloyd went over 14 minutes from the end and Jones added the extras via an upright, leaving them two points down.
But the visitors proved equal to the challenge to create a decisive response that ended with Ford going over to secure the win for the Cook Islands.
Cook Islands boss David Fairleigh: "That was great. It was Cook Islands first World Cup victory and it was great to finish on a high note."
Wales: Kear, Roets, Lloyd, R. Evans, Massam, Jones, Lupton, Flower, Budworth, James, Divorty, Frizell, Patrick.
Replacements: White for Roets (25), Kopczak for Lloyd (24), Dudson for Flower (27), Walker for Patrick (28).
Cook Islands: L. Lulia, Taripo, Takairangi, K. Lulia, Pittman, Ford, John, Napa, Fepuleai, Taia, Sopoaga, Peyroux, Arona.
Replacements: Gelling for Takairangi (30), Matapuku for Napa (23), Brunton for Fepuleai (55).
Ref: Richard Silverwood (England).