It started out as a dour contest but it ended as an epic as Donegal overcame Derry to reach the Ulster semi-final in MacCumhaill Park, Ballybofey.

Patrick McBrearty, who had been limited to a free by Chrissy McKaigue, hit two points in added time to decide the issue.

His first put them ahead for the first time on 71 minutes and when Shane McGuigan levelled matters again, McBrearty stepped up to fire over a classic winner in the 74th minute.

As expected Donegal started without Michael Murphy while they were also without livewire Peadar Mogan.

It was typical Ulster fare from the dark ages in the first half as both sides got men behind the ball. Derry had two goal chances inside five minutes with the Donegal goal lucky to stay intact.

Benny Heron eventually opened the scoring on seven minutes or the visitors and they doubled their lead through Shane McGuigan as Shaun Patton's kick-out went astray.

Jamie Brennan got Donegal on the board in the 12th minute but by the water break Padraig Cassidy came forward from half-back to have Derry 0-4 to 0-2 ahead. That lead was doubled through Conor Glass and a Shane McGuigan free as Derry maintained the upper hand.

Eventually Donegal began to find the range with Jamie Brennan pointing and two quickfire points from Michael Langan reduced the margin to the minimum by the 25th minute. But the dourness of the contest ensured there was no further score in the opening half to leave it 0-7 to 0-6 in favour of Derry at the break.

Heron saw a goal effort come back off the crossbar

The early stages of the second half were close before Derry went four up - 0-12 to 0-8, which saw Donegal send Michael Murphy into the fray.

Gradually Donegal got back in the game with Paul Brennan, Murphy and two Niall O'Donnell points had them level with ten minutes to go.

Then came the very exciting finish with Donegal just getting over the line.

Donegal: Shaun Patton; Eoin McHugh, Neil McGee, Stephen McMenamin; Ethan O'Donnell, Odhrán McFadden Ferry, Eoghan Bán Gallagher; Hugh McFadden, Caolan McGonagle (0-02); Ciaran Thompson, Ryan McHugh, Niall O'Donnell (0-03); Michael Langan (0-03), Patrick McBrearty (0-03,2f), Jamie Brennan (0-02).

Subs: Brendan McCole for McMenamin 40; Paul Brennan (0-01) for McFadden Ferry 44; Michael Murphy (0-02,2f)for J Brennan 47; Odhrán Mac Niallais for E O'Donnell 49; Oisin Gallen for Thompson 70

Derry: Oran Lynch; Chrissy McKaigue, Brendan Rogers, Padraig McGrogan; Padraig Cassidy (0-01), Gareth McKinless (0-01), Conor Doherty (0-01); Conor Glass, Emmett Bradley (0-01); Ethan Doherty, Niall Loughlin (0-01), Ciaran McFaul (0-03); Benny Heron (0-02), Shane McGuigan (0-04,2f), Paul Cassidy.

Subs: Oisin McWilliams for Heron 56; Niall Toner for Paul Cassidy 59; Conor McCluskey for E Doherty 62; Paul McNeill for N Loughlin 70+3

Referee: David Coldrick (Meath)