Brentford reinforced their push for a play-off place with victory at relegation-threatened Oldham, but were forced to work hard to claim the points.
And it was on-loan striker Scott Fitzgerald, who ironically recently almost joined Latics on trial, who was the Bees' goalscoring hero.
Watford forward Fitzgerald had been due to join Oldham only for that temporary move to be called off following Brian Talbot's departure as manager.
While Martin Allen's side had plenty to cheer as they registered their first win at Boundary Park since 1934, Oldham's plight worsened and they have now won only once in their last nine league matches.
Oldham were aggrieved not to have been awarded a penalty late in the first half when striker Kenny Cooper's close-range shot struck the hand of defender Michael Turner.
Will Haining had a header well saved by Bees keeper Stuart Nelson early in the second half and the visitors rode their luck at times.
Brentford broke the deadlock in the 54th minute after Oldham were punished for woeful defending as Jay Tabb fired a ball across the face of goal for Fitzgerald to turn in from a couple of yards.
Oldham had no luck as Cooper, who is on loan from Manchester United, saw a glorious volley beat Nelson only to clip the top of the crossbar.
Brentford sealed victory midway through the second half when Darren Pratley fired in a low cross from the right and Fitzgerald reacted first to fire home at the near post.
In the dying minutes Haining struck the crossbar as Oldham were unable to find a route to goal.