First Division Finn Harps fought back from being 2-0 down at Finn Park to beat their Premier Division neighbours Sligo Rovers and book their place in the last eight of the eircom League of Ireland League Cup.
Sligo made the breakthrough on 31 minutes when Jason McCartney whipped in a left wing cross for the unmarked Matthew Judge to rise and firmly head beyond the reach of James Gallagher.
And the visitors doubled their advantage on the stroke of half-time through Stephen Manson.
Harps were given a lifeline on 63 minutes when substitute Conor Gethins pulled one back with a long range effort and a looping header from another substitute, Stephen Parkhouse, on 87 minutes left it at 2-2.
Parkhouse then grabbed a dramatic injury time winner which was set up by Chris Breen.
Finn Harps: Gallagher, Roddy, Minnock, Boyle, Asokuh, McGowan, Curran, O'Loughlin, Breen, Brown, Holmes. Subs: Gethins for Curran (45 mins), Parkhouse for Brown (60 mins).
Sligo Rovers: Brush, Peers, Foy, McKenzie, Vasas, Turner, Manson, Hughes, Judge, Kudozivic, McCartney. Subs: Aisien for Judge (60 mins), Bajdziak for McCartney (61 mins), Kelly for Bajdziak (71 mins).
Referee: Mr N Doyle (Dublin).