A goal in the last minute from substitute Ciaran Shanley propelled Westmeath past Wexford and into the quarter-final.
Wind and rain made for difficult conditions in Mullingar on Saturday and it was a physically bigger Wexford side who coped better in the first half.
But shooting was erratic. That said, Donal Shanley, their most impressive forward, kicked three points to help his side to a 0-6 to 0-4 advantage at the half-time break.
The Slaneysiders increased their lead to five points by the 43rd minute, as the hosts struggled.
However, substitute Rob Hickey opened Westmeath's second-half tally with an inspirational point and the hosts, inspired by Luke Loughlin, rattled over five more unanswered points by the 59th minute.
Shanley's goal settled the issue when he pounced on a misdirected short kick-out to secure victory.
SCORERS – Westmeath: L Loughlin 0-5 (2fs), C Shanley 1-0, J Corbally (1f), J Scully 0-2 each, R Hickey 0-1. Wexford: D Shanley 0-4 (3fs), J Carty, N Hughes, P Barden, C O'Rourke, J Bolger, T Byrne 0-1 each.
WESTMEATH – S Keenan; B O'Donohoe, M Darling, B Sayeh; D Giles, R Caffrey, L Beddows; D Lyons, T Watts; R Cunningham, A Hughes, J Scully; J Corbally, S Clavin, L Loughlin. Subs: R Hickey for Clavin (36), G Murray for Lyons (49), C Shanley for Sayeh (52).
WEXFORD – D Cloke; D Redmond, J Rossiter, J Reville; N Rossiter, G Staples, J McDonald; P Barden, N Hughes; B Cowman, O Roche, D Shanley; T Smith, J Carty, C O'Rourke. Subs: T Byrne for Carty (30), J Bolger for Smith (h-t), C Farrell for Cowman (55).
REF – F Smyth (Offaly)