A superbly created and finished goal from Jake Keegan snatched all three points for Galway United at the City Calling Stadium.
In a very open first half, each side was guilty of poor finishing as opportunities were wasted at both ends.
While Galway defender Marc Ludden cleared off the line from a Gary Shaw header, visiting keeper Conor Winn was worked by David O’Sullivan and Ayman Ben Mohamed drilled a half volley narrowly wide, the two clearest chances fell to Galway.
Six minutes in, Galway captain Ryan Connolly got free on the left to put over a sublime cross for Gary Shanahan, but the winger sliced his header tamely wide.
Keegan should then have done better than blaze over the top when put clean through by Alex Byrne on 34 minutes.
Though Longford showed more endeavour from the start of the second half with Ludden making a terrific block to clear a drive from home skipper Mark Salmon seven minutes in, Galway stole what proved the winner with their first attack of the second half on 61 minutes.
Gary Shanahan showed clever feet to nip past Connor Powell down the right to whip over an excellent cross which Keegan finished to the net with a well-placed looping header.
It might have been 2-0 five minutes later. Keegan found space in the box to set up David O’Leary whose shot was cleared off the line by defender Rhys Gorman.