Ray Putterill's double helped Accrington knock Oldham out of the FA Cup with a 3-2 win but not without a nail-biting finish.
Stanley raced into a deserved two-goal lead in the first half, first midfielder Putterill scored a superb solo goal, ghosting past the Latics defence and firing a low show past Dean Brill from the edge of the box after eight minutes.
Putterill then made the second playing in an accurate cross which Jimmy Ryan slotted home after 36 minutes.
Straight after Oldham striker Oumare Tounkara hit the post with a 20-yard effort as the League One side suddenly woke up.
And they came out with more purpose after the break with Richie Jones inches off with a 20-yard strike.
But it was Stanley who extended their lead. Luke Joyce hit the post and Oldham failed to clear their lines with Putterill charging in and rifling home his second of the game after 52 minutes.
Latics substitute Warren Feeney reduced the arrears after 69 minutes drilling home a low shot from 18 yards for his first goal of the season.
And then Dean Winnard fouled sub Filipe Morais in the area and Dale Stephens tucked home the penalty to set up a nervy ending. Stanley hung on despite Feeney having a late effort ruled out for offside and Paul Black hitting the post in injury time.