With their backs to the wall, Wexford produced their best performance of 2022 to beat Kilkenny by 1-22 to 1-18 to progress to the All-Ireland series.
After a sluggish opening to the Leinster Championship, the Model County's season looked to be stuttering to a halt, particularly after last week's draw with Westmeath.
However, Darragh Egan's charges relied on their survival instincts to upset the Cats at Nowlan Park; a result which knocks Dublin out of the championship.
Strangely, it was also a case of mission accomplished for Kilkenny, as Galway's 0-27 to 0-21 win over the Dubs sent Brian Cody's side into the provincial decider against the Tribesmen.
Wexford made a storming start to the contest, tearing into their hosts physically as they looked to lay down a marker. However, in the early stages it looked like it was more of the same for the Model County, as their struggles in front of goal continued.
They shot five wides in the opening 10 minutes, with the Cats bursting into a 1-4 to 0-2 lead. The three-pointer came via the in-form Martin Keoghan, who beat Mark Fanning to help the Noresiders into the five-point cushion.
But Wexford soon found their range, and it was Kilkenny who then began to struggle in front of the posts.
Diarmuid O'Keeffe, Rory O'Connor and Liam Óg McGovern all raised white flags, as the home side went 15 minutes without a score.
Wexford then took the lead as half-time approached. A long dropping ball fell into the hand of Oisín Foley, and the Crossabeg-Ballymurn man found the net as Wexford took a 1-11 to 1-8 half-time lead.
It could have been even better for the Yellowbellies, but for a stunning stop from Eoin Murphy on Conor McDonald on the stroke of half-time.
Much of the second half became a free-taking contest between TJ Reid and Lee Chin. Both kept the scoreboard ticking over from placed balls, as Fergal Horgan dealt with the increasing on-field tensions.
As Galway pulled clear in Salthill, it became clear that it was not a game that Kilkenny needed to win. It didn't change the fact that Wexford needed the win, however, and that perhaps was the difference.
Egan's bench produced three points from play, as they gave the team a real bounce down the home straight.
When Damien Reck produced a last-gasp goal-line save to deny Eoin Cody, it became clear it would be Wexford's game.
And they held out for a hard-fought four-point win.
Both sides left Nowlan Park with exactly what they came for. Wexford with their berth in the All-Ireland series. Kilkenny with their Leinster final spot.
But it is Egan who was clearly the happier of the two managers.
Attendance: 13,565
Referee: Fergal Horgan (Tipperary)
Scorers
Kilkenny: TJ Reid (0-10, 0-8f, 0-1 '65), Martin Keoghan (1-1), Mikey Carey (0-2), Adrian Mullen (0-2), Padraig Walsh (0-1), Walter Walsh (0-1), Billy Ryan (0-1, 0-1sl).
Wexford: Lee Chin (0-9, 0-7f), Oisin Foley (1-0), Simon Donohue (0-2), Diarmuid O'Keeffe (0-2), Rory O'Connor (0-2), Liam Ryan (0-1), Jack O'Connor (0-1), Liam Óg McGovern (0-1), Conor McDonald (0-1), Cathal Dunbar (0-1), Mikie Dwyer (0-1), Connal Flood (0-1).
Teams
Kilkenny
1. Eoin Murphy
4. Tommy Walsh
3. Conor Delaney
7. Paddy Deegan
5. Michael Carey
6. Richie Reid
2. Mikey Butler
8. Alan Murphy
9. Adrian Mullen
23. Walter Walsh
11. TJ Reid
26. Tom Phelan
13. Cian Kenny
15. Eoin Cody
14. Martin Keoghan
Subs
Billy Ryan for Tom Phelan (45)
James Maher for Alan Murphy (54)
Padraig Walsh for Cian Kenny (68)
John Donnelly for Martin Keoghan (70)
Wexford
1. Mark Fanning
7. Paudie Foley
3. Liam Ryan
4. Conor Devitt
5. Matthew O'Hanlon
6. Damien Reck
2. Simon Donohue
8. Diarmuid O'Keeffe
12. Liam Óg McGovern
10. Jack O'Connor
11. Kevin Foley
13. Oisín Foley
15. Rory O'Connor
14. Conor McDonald
9. Lee Chin
Subs
Connal Flood for Conor Devitt (42)
Mikie Dwyer for Jack O'Connor (55)
Cathal Dunbar for Kevin Foley (57)
Charlie McGuckin for Oisin Foley (62)