JAMIE McGONIGLE ended Derry City' s eight year wait for a win at Oriel Park and it was a precious come-from-behind victory which secured an incredible fourth place finish.
With Bohemians held to a draw against Sligo Rovers, Derry's Europa League dream remains alive and McGonigle's goal could be worth £250,000 for the Brandywell club should St Pat's win the FAI Cup next weekend.
It was an incredible final match of the season with Derry falling behind to a stunning Sean Murray strike after 33 minutes.
However, the visitors weathered the storm and turned the game on its head during seven minutes in either half.
Ciaron Harkin scored a remarkable 35 yards goal to get Derry level on the stroke of half-time.
And seven minutes into the second half McGonigle fired clinically into the bottom corner to give Derry the lead.
Harkin produced an unbelievable goalline clearance to deny Murray as Dundalk pressed but despite the best efforts of ex-Derry striker Georgie Kelly who cancelled out Johnny Kenny's opener in Sligo, it was the Candy Stripes who clinched fourth spot.
It was the fitting end to what has been a remarkable transformation under Ruaidhri Higgins who took over a team rooted to the bottom of the table after six games.
Cameron McJannet and Darren Cole had returned to the starting line-up replacing the suspended Eoin Toal and Junior Ogedi-Uzokwe who was ineligible against his parent club.
Brandywell bound Michael Duffy was named on the bench on what was his farewell match at Oriel Park where he won two league titles and two FAI Cups.
The injured Patrick McEleney took his place in the stands but received a special reception from the home support and the travelling City fans at half-time as he received his club 'goal of the season award for his sublime goal against Vitesse Arnhem in the Europa League last summer.
Dundalk were first to threaten the opposition goal after the ball fell kindly to Pat Hoban inside the Derry penalty area with his back to goal on six minutes. The striker turned neatly but his shot was crucially blocked by McJannet. The rebound found Sean Murray who blasted over the bar.
The Lilywhites appealed for a penalty on 10 minutes when Murray spread the ball superbly to the right wing where Sami Ben Amar attempted to take it past Coll before going to ground just inside the penalty area. Referee, Neil Doyle waved away the protests.
Moments later Hoban found himself clean through on goal and just as he was about to pull the trigger 12 yards from goal, Cole produced an outstanding sliding challenge to avert the danger.
At the Sligo Showgrounds, the Bit O'Red had gone in front against Derry's rivals for fourth spot Bohemians thanks to Johnny Kenny.
Nathan Gartside denied Murray from a free-kick on the half hour mark, the City keeper palming it over the crossbar.
Dundalk broke the deadlock on 33 minutes as Murray brushed off the challenge of Cole after Harkin lost possession, before firing a stunning strike past Gartside from 25 yards.
Two minutes later Coll failed to clear the danger and Raivis Jurkovskis' strike deflected off the head of McJannet and bounced narrowly wide.
Jamie McGonigle tried his luck with a snapshot from the edge of the area but Peter Cherrie got down low to punch it away at his near post five minutes before the break.
Derry were back on terms in spectacular fashion on 45 minutes as Harkin rattled the back of the net from 40 yards with the aid of a slight deflection.
It was a special strike from the midfielder and McGonigle had a chance to give Derry the lead moments later after taking it past Dan Cleary on the edge of the box but he was denied by a smart save from Cherrie who stood tall.
Seven minutes after the break Derry completed the turnaround as Fitzgerald threaded the ball through to McGonigle who held his run before firing into the corner of the net with a composed finish.
It was the Dungiven man's eighth goal of the season to take him top of the club's scoring chart with his fourth in three games.
Two goals in seven minutes turned the game on its head and with Bohs still trailing in Sligo, the night was going very much to plan for Higgins' troops.
Harkin came to Derry's rescue with an unbelievable 'Jackie Chan' style clearance to deny Murray what looked like a certain goal on 63 minutes.
At the Sligo Showgrounds Bohemians were back in the game as Georgie Kelly, returning from injury fired them level with his first touch with 12 minutes to go.
As it stood, Derry were in fourth but they held a precarious lead at Oriel as Dundalk pressed for an equaliser.
Hoban almost found the net on 90 minutes as the striker stooped to get his head to an inswinging cross but he directed his effort just wide of the far post.
The four official signalled four additional minutes as Derry held on desperately but it was their night and Higgins and his players celebrated the win and the news of Bohemians draw in front of the large City support.
Dundalk: P. Cherrie: R. Jurkovskis, A. Boyle, D. Cleary, D. Leahy; C. Dummigan (M. Animasahun 90) S. Stanton, S. Murray (M. Hanratty 90), S. Ben Amar (D. Kelly 53), D. McMillan (R. O'Kane 68), P. Hoban; Subs Not Used - A. Abibi, S. Nattestad, , M. Duffy, W. Zahibo, H. Jeongwoo.
Derry City: N. Gartside; D. Cole, C. McJannett, C. Coll; R. Boyce, C. Harkin, J. Thomson, D Lafferty; J. McGonigle (B. Hery 88), J. Akintunde, W. Fitzgerald (J. Malone 81); Subs Not Used - J. Lemoighnan, . McChrystal, G. Storey, E. McLaughlin, M. Harris, P. Ferry, C. Porter.
Referee- Neil Doyle (Dublin).