Dundalk are assured of a top-three finish for the first time since they last won the league title in 1995 after a Richie Towell hat-trick eased them to victory at Oriel Park.
Hopes of recreating that title success of 18 years ago are still a long shot but this win moves the Lilywhites back into second place, three points behind league leaders St Patrick's Athletic, albeit with a game extra played.
The result guarantees the Louth club European football for next season, although whether that is in the Champions League or the Europa League remains to be seen.
Derry City had a great chance to take the lead after just six minutes when former Dundalk star Michael Rafter broke clear into the penalty area.
He knocked the ball past Peter Cherrie before hitting the deck but, instead of awarding a penalty, referee Graham Kelly adjudged the Tipperary man to have taken a dive, issuing a yellow card to the stunned Derry City striker.
The Dundalk breakthrough came in the 26th minute. Kurtis Byrne chested the ball into the path of Towell and his half-volley into the ground beat Ger Doherty to find the Derry net.
Towell claimed a second in as many minutes after a great move culminated in him smashing home with a fine half-volley from 25 yards.
Both goalkeepers were redundant for much of the second period but Doherty had to pick the ball out of his net again in the 66th minute after Towell had completed his hat-trick by placing the ball around the 'keeper after being set free by Byrne.
Dundalk – Cherrie; Rossiter (Rossiter 69), Gartland, Boyle, Massey; Dillon, Shields, Towell (Mountney 90), Meenan; Byrne, Hoban (Faherty 63).
Derry City – Doherty; Madden, S McEleney, Jarvis, Osborne (Kavanagh 59); P McEleney, Molloy, Higgins, McNamee; Rafter, Patterson.
Ref – G Kelly (Cork).