Oldham booked another clash with Liverpool at Anfield next month as they ended the challenge of Mansfield and won the second-round replay 4-1.
The Stags had also played Liverpool in last season's competition and were hoping for another dose of the big time.
It even looked on the cards after 12 minutes when Sam Clucas sent Lindon Meikle to the left by-line from where he picked out the head of Ross Dyer, who made no mistake from almost on the line.
Clucas almost made it 2-0 after 23 minutes but failed to get his left-footed finish on target from Dyer's lay-off.
Jonson Clarke-Harris warmed home keeper Alan Marriott's hands with a rasping 30-yard free kick and also saw an offside flag raised before he rolled the ball into the home net and Mike Petrasso was just wide from a James Tarkowski nod-down as the home side defended manfully.
But Mark Oxley's low save from Meikle after 52 minutes proved crucial for the visitors as Danny Philliskirk buried a superb 18-yard free-kick into the top right corner five minutes later.
Petrasso then set up Clarke-Harris to make it 2-1 with a low shot after 62 minutes and the floodgates opened.
Matteo Lanzoni headed home a Philliskirk corner after 76 minutes before Adam Rooney completed the scoring from the spot nine minutes from time after John Dempster had been harshly penalised for handling a Clarke-Harris blast at close quarters.
Dempster was then dismissed to add insult to injury on a night to forget for Stags.