Waterford staged an amazing second-half comeback to snatch victory from Galway thanks to a John Mullane point a minute from time.
There could not have been a more dramatic finish at Semple Stadium as Waterford set up a semi-final meeting with All-Ireland champions Kilkenny on 9 August.
Galway looked to be cruising when they led by six points after 57 minutes of this quarter-final clash, but Déise boss Davy Fitzgerald made three key substitutions, bringing on the Shanahan brothers, Dan and Maurice, and Shane Walsh.
And all three played major roles in the win which gives Fitzgerald's men a chance to gain revenge on Kilkenny for last year's final hammering at Croke Park.
Dan Shanahan missed a goal chance but two minutes from the end, he set up Shane Walsh for a cracking goal which levelled this Thurles tie.
And in the decisive play in injury-time, John Mullane scored his only point to earn a famous win against a Galway side for whom Joe Canning scored nine points - one kicked effort and the rest from placed balls.
But crucially Canning fluffed a last-second chance to force extra-time when he shot wide.
At the end of a disappointing first half, the Tribesmen, recent conquerors of Cork, were four points in front (0-11 to 0-07) after dominating most of the exchanges.
The highlight of the half was a kicked point by Joe Canning who also scored three points from frees and one from a sideline cut.
Aonghus Callanan scored two points from play and Damien Hayes and Ger Farragher had the other two points.
Waterford never got going in the opening 35 minutes and five of their points came from frees by Eoin Kelly, with Kevin Moran and Seamus Prendergast getting their only scores from play.
Both sides were unhappy with decisions by the umpires and the most controversial came with a last-second ruling wide of a doubled effort from Kelly.
Backed by the breeze in the second half, Waterford began at pace and Kinvara clubman Colm Callanan made a superb save to deny Mullane a goal.
But points by Kevin Moran and another Kelly free cut the deficit to two points.
A pointed free by Canning settled Galway and a well-taken point by Damien Hayes restored their four-point advantage, before Canning (free) and Ger Farragher had John McIntyre's side six in front.
Eoin Kelly and Canning swapped points before Kelly had four in a row, three of them from frees, to set up a tremendously tense finale.
Galway went two points in front again before Dan Shanahan plucked a high ball down and pass to the right for Walsh to bat right-handed past Callanan and into the back of the net.
That priceless goal was followed by a pointed free by Kelly and with a defiant Waterford inspired by their on-field captain Stephen Molumphy, they pounced for the all-important winner when Mullane ended his scoreless streak.
Scorers: Waterford, E Kelly, 0-12, (0-11f), S Walsh, 1-0, K Moran, 0-2, S Prendergast and J Mullane, 0-1 each.
Galway: J Canning, 0-9 (0-5f, 1 ‘65’), D Hayes, 0-3, G Farragher and A Callinan, 0-2 each, J Gantley, and A Smith, 0-1, each
Waterford: C Hennessy; E Murphy, D Prendergast, N Connors; T Browne, M Walsh, A Kearney; K Moran, S O’Sullivan; J Nagle, S Prendergast, S Molumphy (capt); J Mullane, E Kelly, S Casey.
Subs used: M Shanahan for Nagle, 44, S walsh for Casey, 54, D Shanahan for Moran, 63.
Galway: C Callanan; D Joyce, E McEntee, O Canning (capt); F Moore, J Lee, E Lynch; G Farragher, K Hynes; A Callanan, C Donnellan, A Smith; D Hayes, J Canning, N Healy.
Subs used: J Gantley for Healy, 55, K Hayes for Donnellan, 60 mins
Referee: Diarmuid Kirwan, (Cork)