After a two-week hiatus, New Zealand will snatch back the No.1 ranking in world rugby, with Wales suffering a 22-17 loss to Ireland - and losing the top spot - in their Rugby World Cup build-up.
The Irish, inspired by two-try Jacob Stockdale, bounced back to ruin Warren Gatland's Cardiff farewell, as he vacates the Wales head-coaching role after 12 years.
Stepping down after the tournament in Japan, Gatland fielded a reserve side against an equally experimental Irish line-up in his last home game in charge.
- Fiji impress in win over Tonga
- Manu Samoa battle past NZ Heartland XV
- Springboks star faces four-year doping ban
But he left the Principality Stadium wondering what could have been, as Ireland's fringe players - with first-five Jack Carty to the fore - gelled immediately, while Wales struggled for fluency, before staging a late fightback.
The result ended Wales' 11-game winning home run and also saw them lose their short-lived status as the world's top-ranked side - that accolade will be reclaimed by New Zealand next week, when the rankings are published.
The All Blacks lost their 10-year dominance of the rankings, when the Welsh beat England 13-6 at Cardiff on August 17.
Wales will now fall to fourth, behind New Zealand, England and Ireland.
Shocked 57-15 by England at Twickenham last week, the Irish made 11 changes, while Wales made 14 from their victory over England.
But regular first-choice winger Stockdale, brilliantly set up by fellow flier Andrew Conway, crossed in the left corner after 18 minutes and then pounced on a Welsh handling error to dash over again 10 minutes later.
Trailing 22-3 with 20 minutes left, after conceding a penalty try to the dominant Irish scrum, Wales surged back with two late tries of their own, but could not complete a fairytale ending for Gatland.
While the encounter was essentially a reserve match, it was hugely important for individual players hoping to book a late seat on the plane to Japan.
"Today was massive for us," said man-of-the-match Carty. "We were all hurting during the week, but we came together.
"Our defence was really good for the vast majority of that game against a quality Welsh outfit. We knew they were going to get a purple patch at some stage, but the forward pack gave us a great platform.
"When you have that, it is very easy."
Wales No.10 Rhys Patchell, who came on in the second half, was also hugely impressive in his bid for selection as World Cup back-up for first-choice Dan Biggar.
Patchell quickly brought Wales to life and almost produced the perfect finale in the 76th minute, when he received the ball after a series of Welsh drives and sidestepped over, adding the conversion to bring them to within a single score, before Ireland closed out the game.
Gatland will name his 31-man World Cup squad on Sunday, before Wales and Ireland complete their preparations by meeting again in Dublin next Saturday.
Wales open their World Cup campaign against Georgia on September 23, with Australia, Fiji and Uruguay completing Group D.
Ireland start against Scotland a day earlier, with Japan, Russia, and Samoa the other Group A teams.
Join us for live updates of the 2019 Rugby World Cup from September 20