Galway escaped Portlaoise with their Leinster Championship hopes intact and a 1-22 to 0-23 win, as Laois came within minutes of a massive shock.
Galway got off to a great start thanks to Jonathan Glynn's second-minute goal and they led by 1-03 to 0-00 after nine minutes.
However, a terrific 25 minutes from the home side saw them lead by 0-16 to 1-07 at half-time.
Galway improved slightly after the restart with the wind at their backs and levelled the game by the 60th minute.
They hit the winner two minutes from time through substitute Paul Killeen.
Laois could have forced a deserved winner deep into injury-time, but goalkeeper Eoin Reilly's 20-metre free was well saved on the line.
Galway held on for a two-point win and will play either Kilkenny or Offaly in the Leinster semi-final.
Galway manager Anthony Cunningham will not be happy with this performance, as Laois out-hurled his team for the most part.
Laois were superb in the opening half, with points flowing from all areas of the field, especially the half-back region through Joe Fitzpatrick and Tom Delaney.
Seamus Plunkett's side recovered from a poor start and their tactic of bombarding the Galway full-back line with long deliveries was reaping dividends.
Willie Hyland and Neil Foyle were looking dangerous and punishing Galway's patchy play. Laois deserved their six-point half-time lead.
Galway really only impressed after the introduction of Jason Flynn, who hit a point less than a minute after his introduction to close the gap to five points.
The Tribesmen then followed that score with another five unanswered points to level the game by the hour mark.
In the closing stages, Laois noticeably tired and they only hit two points in the last 19 minutes.
Flynn, Conor Cooney and Padraig Brehony came to Galway's rescue to set up a provincial semi-final against Kilkenny or Offaly in three weeks' time.
GALWAY: C Callanan; D Collins (0-01), R Burke, F Moore; A Harte, I Tannian (0-01), Daithi Burke; J Coen (0-01), P Brehony (0-02); C Cooney (0-07, 0-03f), N Burke (0-02), David Burke (0-01); C Mannion (0-01), J Canning (0-02), J Glynn (1-00).
Subs: P Killeen for Harte (7-9 mins blood), D Hayes for David Burke (48 mins), J Flynn for (0-03) Mannion (51 mins), P Killeen (0-01) for Harte (64 mins), D Glennon for Glynn (70 mins).
LAOIS: E Reilly; JA Delaney, B Campion, B Stapleton (0-01); J Fitzpatrick (0-02), M Whelan, T Delaney (0-02); J Campion (0-01), J Walsh (0-01); S Maher (0-03, 0-03f), D Palmer, C Dwyer (0-03, 0-01sl); N Foyle (0-03), W Hyland (0-03), T Fitzgerald (0-03).
Subs: J Purcell for Foyle (56 mins), P Whelan for J Walsh (58 mins), J Brophy for Fitzgerald (60 mins), R King (0-01) for Campion (63 mins).
Referee: Cathal McAllister (Cork).