Eircom League of Ireland First Division leaders Dundalk looked decidedly average in Flancare Park as they were completely outgunned for long periods by struggling Longford Town.
However, they still managed to piece together a comfortable victory that sees them extend their lead at the top of the table to three points over Sporting Fingal.
The midland outfit comfortably controlled possession before the break.
Darren McKenna, Jason Oladele, Rob Douglas and Luke Hardy all had superb opportunities to put the home side in front as Aaron Callaghan's side produced a first half performance that belied their recent poor run of form.
However, despite their dominance the home side fell behind in the 56th minute when a quick throw-in from John Flanagan was blasted home from all of 25-yards out by Paul Crowley.
Dundalk huffed and puffed their way to a second goal in the 80th minute when Tiernan Mulvenna hooked the ball over Gallagher.
John Gill's side made victory safe just three minutes later when John Flanagan glanced home their third goal.
Longford Town: Gallagher; Gough (Lee 70), Doyle, Brennan, Garry; Murphy (Harte 86), Hardy (Connolly 78), Rushe, Douglas; Oladele, McKenna.
Dundalk: Bennion; Flanagan, Ryan, Whelehan, Crawley; Cassidy, Crowley, Marney, Smyth (O’Connor 59); Farrell (Vaughan 75), Mulvenna (Shiels 84).
Referee: R. Rogers (Dublin)