Goalkeeper Paddy Collum stroked home a late penalty to help Longford to a surprise victory in Mullingar on Saturday afternoon.
Longford led by a point with five minutes to go when Mark Hughes was fouled, and Collum stepped up to coolly convert the spot-kick.
Westmeath pressed valiantly in the closing stages, but all they could produce was a pointed free from John Heslin - who was then sent off for a second yellow card.
The visitors had led 0-5 to 0-2 at the break, after scoring three unanswered pointed in five minutes from Hughes, James McGivney and Darren Farrelly. Two Heslin frees brought Westmeath back to within a point in a scrappy contest, but then Collum struck.
Scorers - Longford: P Collum 1-0, M Hughes 0-3 (0-2f), R Smyth, J McGivney, D Farrelly 0-1. Westmeath: J Heslin 0-4 (0-4f), D McCormack, T English 0-1.
Longford - P Collum; D Bennett, S Goldrick, R Keogh; C Clarke, D Quinn, S Donoghue; J McGivney, D Gallagher; D Farrelly, P McCormack, D Cooney; R Smyth, J Noonan, M Hughes. Subs: P Byrne for J Noonan (47), T Madden for S Donoghue (50).
Westmeath - D Brady; S Gilmore, R Henshaw, C McKinley; D Lynch, D Gavin, J Gonoud; D McNicholas, J Heslin; D Ruane, K Reilly, D McCormack; D Fagan, T English, J Cully. Subs: E Kincaid for D Lynch (28), P Fennell for D Ruane (38), J Maguire for D McCormack (42).
Ref -- Eddie Craul (Wicklow).