Oldham Athletic will play Liverpool in the FA Cup third round after they cruised past Mansfield Town 4-1 at Field Mill.
The Latics will now meet the Reds for the second time in as many years after goals from Danny Philliskirk, Johnson Clarke-Harris, Matteo Lanzoni and Adam Rooney cancelled out Ross Dyer's opener.
Dyer scored after just 12 minutes with a diving header, but Philliskirk levelled things up just before the hour mark.
Oldham were in front on 62 minutes when Clarke-Harris fizzed a low shot into the corner, and the visitors had breathing space when Lanzoni headed home Philliskirk's corner.
Rooney made the result secure from the penalty spot after John Dempster was adjudged to have deliberately blocked a shot with his hand.
The Mansfield man was subsequently sent off for the offence before Rooney converted from 12 yards.
Oldham now meet Brendan Rodgers's side, a team they beat last season, in the New Year.