Striker Scott Dobie booked Carlisle's place in the League Cup second round courtesy of a late header against Oldham at Brunton Park .
The ex-West Brom forward rose above the Latics defence in the 88th minute to nod defender David Raven's deep cross past keeper Dean Brill.
Greg Abbott's men should have been out of sight well before Dobie's heroics as Richard Keogh hit the post and Marc Bridge-Wilkinson blazed over the bar when one on one with Brill.
Carlisle were looking to put their 3-1 home defeat to Brentford on the opening day of the season to the back of their minds and Dobie should have broken the deadlock early on.
Winger Matty Robson's pinpoint cross found Dobie unmarked in the box but he put his header straight in to the arms of Brill.
Bridge-Wilkinson curled an effort past the post soon after before Robson centred for the ex-Bradford man to stab the ball wide of the mark.
Dave Penney's men were on the backfoot and should have gone in to half time a goal down but Keogh's diving header from a Graham Kavanagh corner rattled the base of the post.
Oldham were more of a threat after the break but long-range efforts from skipper Sean Gregan and substitute Pawel Abbott failed to trouble keeper Lenny Pidgeley.
Carlisle skipper Danny Livesey saw a header sail wide while Bridge-Wilkinson should have done better when he caught the Oldham defence napping to break clear but blasted the ball over the bar.
Chris Taylor produced the Latics' best chance of the match in the 82nd minute when he cut in from the left flank and forced Pidgeley in to a superb one-handed save.
But just when it looked like the match was heading in to extra time Dobie popped up with the winner in the dying minutes.