Cavan hung on to clinch a 1-15 to 1-14 win over Westmeath in Saturday's All-Ireland SFC round one qualifier.
Two excellent points from Ger Egan helped the Leinster side to a 0-7 to 0-6 lead at the break in Breffni Park.
Cavan stormed clear on the restart with Niall McDermott netting and Jack Brady adding two points as the hosts moved seven points ahead.
John Gilligan's goal gave Westmeath hope and the gap was reduced to one point in a tense finale.
It was a tight first half in Cavan although Westmeath scored three points without reply thanks to Egan's double and another fine point from Callum McCormack.
Cavan stepped up a gear in the second half, starting with points from David Givney and Robert Maloney-Derham.
The Breffni men found the net on 42 minutes with McDermott finishing after a one-two with Givney.
Cavan looked on course for a comfortable victory as they held a 1-14 to 0-10 advantage, but the game turned with Gilligan's strike after 57 minutes.
The goal was followed by a McCormack point and Westmeath sensed that a comeback was on.
However, with two points between the sides and deep into injury time, Westmeath opted to take a simple point from a free instead of going for the goal.
It was the last action of the game and Cavan had done enough to secure a place in Monday's draw for round two.
"We seemed to lose our way in the last seven or eight minutes but we dug deep, got the victory and that's what it's all about," said Cavan boss Terry Hyland.
"This will bring the team on, it shows how hard work brings victories and we still have a lot to play for."