Stephen Griffin's injury-time point fired Donegal into a National League semi-final against Cork as Donegal snatched a draw from defeat's jaws against Mayo in Castlebar.
Mayo were holding on by the skin of their teeth having kicked nine second-half wides when Griffin pounced. In his first Donegal appearance in 27 months, Griffin slotted over after a patient build-up.
In a fiercely-contested affair in which the 12,304 attendance saw 10 bookings, three black cards and a sending off, Donegal were ahead at the break thanks to Patrick McBrearty's 19th minute goal.
Frank McGlynn and Martin O'Reilly played a neat give-and-go before McBrearty riffled to the top corner. In the absence of Michael Murphy and Neil Gallagher it was McBrearty and Odhran MacNiallais who carried the can for Donegal.
Three superb MacNiallais points in the opening half helped Donegal lead 1-5 to 0-7.
They lost their way somewhat in the second half, taking 19 minutes before Colm McFadden scored.
With Barry Moran excellent, Mayo seemed set for the win when Kevin McLoughlin pointed a late free.
Mayo missed a glut of chances to seal it and they finished with 14 men as Donal Vaughan got his marching orders when he was black carded having already been booked and Griffin's point compounded their frustrations.
Scorers for Mayo: B Moran, K McLoughlin (1f) 0-3 each, J Doherty (fs) 0-2, D O'Connor, M Conroy, S O'Shea, D Vaughan 0-1 each
Scorers for Donegal: P McBrearty 1-3 (1f), O MacNiallais 0-3, M McElhinney, C McFadden, S Griffin 0-1 each.