Wales destroyed Ireland's Grand Slam dream at an emotionally charged Millennium Stadium as they set up a thrilling finale to this season's RBS 6 Nations Championship.
Wales, Ireland - and potentially England - could all be in the title mix in next weekend's final round of Six Nations action, but Irish hopes of a first tournament clean sweep since 2009 ended following a 23-16 defeat.
Substitute centre Scott Williams' second-half try proved the difference in comfortably the best game of this season's championship, while full-back Leigh Halfpenny kicked five penalties and fly-half Dan Biggar dropped a goal.
Ireland responded with a 69th-minute penalty try, plus 11 points from fly-half Johnny Sexton's boot, but they suffered a first defeat in 11 Tests and only their third since coach Joe Schmidt took charge almost two years ago.
Wales were good value for their victory, combining attacking creativity with some remarkable stonewall defending, and Ireland were left a frustrated outfit on the occasion of their skipper Paul O'Connell's 100th cap.
Unlike against England two weeks ago, they could not dominate an opponent that has now strung together three successive Six Nations wins and will head to Rome for an appointment with Italy next Saturday chasing a possible third title in four years, with silverware now likely to be decided on points difference.
It was one of their finest performances since coach Warren Gatland took charge in 2008, with desire and a sheer will to win shining through, especially when skipper Sam Warburton and centre Jonathan Davies were sin-binned in each half.
Wales were unchanged from the side that claimed a fourth successive Six Nations win against France two weeks ago, with Warburton leading his country for a record 34th time, eclipsing Ryan Jones' previous-best total.
Ireland showed one switch following an impressive victory over England last time out, with influential number eight Jamie Heaslip having recovered from three damaged vertebrae in his back suffered against France a fortnight previously, to replace Jordi Murphy.
O'Connell was given a rapturous reception as he led Ireland out, closely followed by 50-cap man Sexton, but it was Wales that took immediate control.
Keeping ball in hand impressively, they exerted sustained pressure on the visitors which Halfpenny rewarded through two penalties inside the opening eight minutes.
And when he completed his penalty hat-trick from the halfway line after just 11 minutes it underlined what a blistering start Wales had made, with Sexton then putting the restart straight into touch.
A fourth Halfpenny penalty then took Wales further ahead, but it came after prop Samson Lee was carried off. The Scarlets tighthead appeared to be hurt after a scrum disengaged, and Ospreys forward Aaron Jarvis took his place.
Sexton missed a chance to open Ireland's account when he drifted an angled penalty chance wide, yet he made amends two minutes later, this time finding his range from just inside Wales' half.
Lee, wearing a medical compression boot and on crutches, then appeared from the changing room to watch the action, but Wales were struggling to regroup and their cause was made more difficult 12 minutes before half-time when Warburton received a yellow card.
Warburton, who was punished at a ruck, appeared to pay the price for referee Wayne Barnes' patience running out after he had awarded a number of penalties for technical offences, and Wales were suddenly up against it.
Sexton kicked a second penalty after Wales scrum-half Rhys Webb received treatment after taking a blow to his lower back, but a sweetly-struck Biggar drop-goal - his second of this season's Six Nations - restored Wales' nine-point advantage.
They continued to manage Warburton's absence well, and although Sexton landed a third penalty just before the break, Wales were good value for their 15-9 interval lead.
In another blow for Wales, Lee's fellow prop - 113 times-capped Gethin Jenkins - did not appear for the second period, suggesting another injury concern, and Scarlets loosehead Rob Evans made his Test debut off the bench.
Ireland exerted relentless pressure during the third quarter but Wales were up to the task defensively, time and time again knocking down Irish attackers, sometimes within inches of their own line.
Wales then stormed upfield and they struck after 62 minutes when Williams, who had only been on the field for five minutes as replacement for Jamie Roberts, sliced through a gap to open up an 11-point lead before Halfpenny's conversion went narrowly wide.
Ireland now had it all to do, yet they fought back and reduced the arrears with 11 minutes left when Wales illegally pulled down a maul, and referee Barnes had little option but to award a penalty try with Sexton adding the conversion.
It set up the kind of nerve-shredding finale such a gripping contest deserved, yet Wales had just enough left in the tank to withstand late pressure and secure a famous victory that was sealed by another Halfpenny penalty.