Donegal had to dig deep to see off a resilient Leitrim side who almost pulled off the shock of the Championship at Carrick-on-Shannon.
Leitrim brought the league champions to extra-time after substitute James Glancy volleyed to the net 'soccer-style', seven minutes into injury-time.
Glancy's goal levelled the sides at 1-11 apiece but five extra-time points, topped off by a 90th minute score from Eamonn McGee, saw Donegal outlast the hosts.
A Michael Murphy goal had the Ulstermen leading 1-05 to 0-06 at half-time but Ciaran Duignan, who finished with 0-07, pegged Donegal back and typified Leitrim's never-say-die attitude.
Having been destroyed by Tyrone last time out, Brian McIver's Donegal bounced back to winning ways in glorious sunshine at Páirc Sean MacDiarmada - but only just.
This was far from the commanding victory that many observers were predicting.
Glancy's injury-time goal reminded many of the late strike which helped Donegal end Armagh's Ulster Championship tilt but Donegal did do just enough to warrant tonight's win, with Rory Kavanagh particularly impressive.
The game threatened to spill over in the 25th minute but referee Gerry Kinneavy kept a tight reign on matters and the players quickly dispersed after the Roscommon official pulled Leitrim's Donal Brennan aside and showed him the second yellow card of the contest.
With Leitrim holding a commanding 0-06 to 0-02 lead at this stage and dominating possession, it looked like Dessie Dolan Senior's men would continue to maintain their early pace but suddenly Donegal sprung to life.
Scores from Brendan Devenney and Kevin McMenamin cut the gap to two points five minutes before the interval.
However, Donegal were now full of confidence and when Leitrim were gifted a penalty, Paul Durcan showed great reflexes between the posts to deny the hosts a goal.
Busy half-forward Declan Maxwell was pulled down for the penalty, but Michael Foley failed to hit the back of the net as a fully out-stretched Durcan brilliantly stopped the centre-forward's kick.
Donegal bounced back with Ryan Bradley converting a point at the opposite end to cut the gap to the minimum before a rifled kick from Michael Murphy, following a McMenamin pass, wormed its way to the Leitrim net and ensured that the visitors took a 1-05 to 0-06 advantage into the second half.
The second period was very much an even affair with the teams going point-for-point, with little separating the sides in the possession stakes.
Just three points came from placed balls in the second half with Ciaran and Michael Duignan converting a free and a '45' respectively for the home side, while McMenamin took Donegal's lone pointed free in the 16th minute of the second half.
Both teams nabbed some inspirational points from play with Leitrim defender Dermot Reynolds cutting the gap to two points 11 minutes into the half.
Murphy's goal proved to be the real difference between the sides for the majority of the second half and indeed into injury-time.
However, with at least six minutes of injury-time to play, there was still enough time for Leitrim to find the back of the net and second half substitute Glancy brought his haul to 1-02 with a 77th minute goal, which saw him make full use of a long hopeful ball in towards the Ulstermen's square.
Despite this, the home side failed to score in the first period of extra-time and Donegal gained points from Rory Kavanagh (0-02) and Christy Toye, and although Ciaran Duignan, who was reintroduced after a brief sojourn, was impressive on the restart with two points, Donegal somehow held on for a win.
Leitrim: N Gill; D Reynolds (0-01), M McGuinness, B McWeeney; C Kennedy, J McKeon, S Foley; G McCloskey, M Duignan (0-2, 1 '45'); C Regan, M Foley, D Maxwell (0-01); D Brennan, F McBrien (0-01), C Duignan (0-07, 4f).
Subs used: B Prior for Regan (25 mins), S Canning for Kennedy (half-time), J Glancy (1-02) for Brennan (41), J Guckian for C Duignan (57), D O'Connor for M Foley (70), P Gilmartin for Foley (77), C Duignan for O'Connor, D Brennan for McBrien (both 80)
Donegal: P Durcan; N McGee, P Campbell, K Lacey; F McGlynn, B Monaghan, P McConigley; N Gallagher, K Cassidy; M Murphy (1-1), M Hegarty (0-02), R Kavanagh (0-02); K McMenamin (0-03, 2f), R Bradley (0-02), B Devenney (0-03).
Subs used: N McCready for Campbell (55 mins), E McGee (0-01) for McConigley (64), C Toye (0-01) for Hegarty (66), M McElhenny for Murphy, S McDermott (0-01) for Devenney (both 70), T Donoghue for McGee (half-time, extra-time), M Hegarty for Bradley (83), C Dunne for McElhenny (84).
Referee: Gerry Kinneavy (Roscommon).