Wales 17 Ireland 22
The All Blacks are, once again, the top ranked rugby team in the world.
Wales have lost top spot in the world rugby rankings and dropped to fourth after a home defeat to Ireland.
A win by a margin of less than 15 points for the Irish now means they have climbed from fourth to second and the All Blacks have resumed the top spot. England are the third-placed team.
If Ireland had beaten Wales by more than 15 points, they would have become number one in the world for the first time in history.
Now, assuming England, New Zealand and Australia all win their respective games next weekend by more than 15 points (against Italy, Tonga and Samoa respectively), Wales would need to beat Ireland by more than 15 points in Dublin to go to the World Cup as the number one side in the world.
A Welsh win by less than 15 points in Dublin would see Wales climb to second, behind the All Blacks, while a draw with Ireland would see Ireland climb to second, Wales climb to third, and England drop to fourth.
Any defeat to Ireland next weekend will see Wales head to the World Cup ranked fourth in the world.
Such are the vagaries of World Rugby's ranking system that despite their annus horribilis on the pitch, culminating in last weekend's 57-15 shellacking at Twickenham, Ireland would have replaced Wales as world No 1 had they won this match by more than 15 points.
They nearly did it, too. At one point in the second half Joe Schmidt's team were 22-3 up and cruising. The two late tries Ireland conceded as Wales belatedly came to life will annoy Schmidt more than the lost No 1 ranking, as they ultimately ran out 22-17 winners.
The Ireland coach will be delighted with the response he got from his team though.
There is only so much you can read into these warm-up clashes. This was very much a Wales 'B' team against a mix-and-match Ireland side, and the game was played in front of a strangely subdued crowd considering it was Warren Gatland's 67th and final home game as Wales coach.
But still. After their beating at Twickenham, it was a hugely welcome performance from an Irish perspective with a number of fringe players putting their hands up for World Cup selection.
Dave Kilcoyne was monstrous in the first half, making eight tackles, winning two scrum penalties, carrying for 31 metres and beating five defenders including Josh Navidi and Samson Lee in the build up to Stockdale's first try. Will Addison and Andrew Conway both had fine games in the Ireland back three, while James Ryan made a tangible difference in the Ireland engine room. Even those who might have been mentally scarred from last weekend looked sharper. Perhaps that was just Jacob Stockdale's haircut. Like Samson in reverse, the Ulster winger looked a man reborn without the flowing mane which adorned his head last weekend.
Schmidt will also have been delighted with what he saw from Jack Carty at fly half.
With Joey Carbery unlikely to be ready before the Scotland game, and Johnny Sexton still wrapped up in cotton wool, Schmidt desperately needs another 10 to step up to the plate.
Carty, on only his fourth cap, was named man of the match, deserved reward for performance which showed guts as well as accuracy.
Wales arguably learnt less from the afternoon's activities. Rhys Patchell and Tomos Williams came on and made a difference in the second half, with Patchell - whose try five minutes from time got Wales back to within five points - likely to get the nod over Jarrod Evans on this showing. But by then the game had broken down amid all the substitutions.
Ireland were the better team for an hour. In classic Gatland fashion, the Kiwi had lobbed a snarky grenade into the Irish camp in the build-up, suggesting Schmidt was unsure of his best lineup, that his players might be "too old", that Wales could "derail" Ireland's World Cup train.
His barbs would undoubtedly have rankled with Schmidt, who sees and hears everything from his bunker. But instead of unsettling Ireland, they had the effect of awakening Irish pride. The visitors were sharper, snappier than their hosts for the first hour at least.
Stockdale produced an early turnover after a tackle on Owen Lane and that set the tone for the first half.
Jarrod Evans, auditioning for his role as back-up to Dan Biggar, produced with a mixed bag. He did well to clear his lines after collecting an Addison grubber and rounding Andrew Conway. He also produced one peach of a crossfield kick to Lane. But he missed an easy penalty when Wales were trailing 10-3.
Ireland scored with their first shy at the posts, Carty making no mistake after captain for the day Josh Navidi strayed offside.
Wales drew level from right in front of the posts after their own captain for the day Peter O'Mahony was pinged for failing to release.
Stockdale's first was a beauty. Kilcoyne made the initial break, then Carty skipped through the midfield offloading to Conway who stepped inside a couple of tacklers before spinning the ball out to Stockdale. Carty converted from the touchline as well.
Wales only had themselves to blame for Stockdale's second. Wales had possession on the halfway line, but Aaron Shingler's attempted offload out of the back of his hand fell behind all of his team mates. Stockdale fly hacked the loose ball and collected to touch down in the corner. "Come on Wales, wake up!" screamed a disgruntled fan behind the press box.
Wales close to 70 per cent of the territory in first half but very little to show for it. A pitch invader in tight shorts had more success getting in behind Ireland..
The start of the second half continued in the same vein. Wales tighthead Samson Lee was replaced by Leon Brown, only to come back on when Brown, who was suffering a torrid time up against Ireland's replacement loosehead Andrew Porter, was deemed guilty of collapsing one too many scrums. He had only lasted 10mins.
Conway touched down in the corner for the try which looked as if it would carry Ireland to No 1 but it was ruled out for a forward pass,. They got it a few minutes later, though, referee Romain Poite putting the entire stadium out of its misery by awarding Ireland a penalty try after 10 mins of scrum retakes.
It took an Owen Lane try in the corner to wake the crowd up again, and Wales belatedly began to apply some pressure, replacement halfbacks Williams and Patchell injecting some pace into proceedings.
Patchell it was who got Wales's second try five minutes before the end, scampering through after a period of heavy Welsh pressure. But it was too little too late, Ireland restoring some much needed pride and momentum back into their World Cup campaign.
The two teams will do battle again in Dublin next week, when it is Gatland will attempt to get his own back by ruining Schmidt's farewell party.