A first-half double from Reggie Lambe’s teammate Hallam Hope helped Carlisle secure a home FA Cup third-round tie against Sheffield Wednesday as they pulled off a 3-1 replay win over League One Gillingham.
Shaun Miller added a third for the Cumbrians in added time after Scott Wagstaff had pulled a goal back for Gills, but Hope's clinical finishing proved key in an all-action thriller.
Gillingham came out of the blocks positively but it was Carlisle who took a seventh-minute lead.
Gary Liddle won the ball in midfield and Richie Bennett provided the final ball for Hope, who finished the move with a firm right-foot shot that took a deflection off Ben Nugent as it went in at the near post.
The visitors continued to pose a threat and after on-loan Brentford goalkeeper Bonham tipped over a Lee Martin effort he then blocked an Alex Lacey header at point-blank range.
Hope grabbed his second goal of the game in the 37th minute, turning home Bennett's low cross after the Carlisle striker had got away on the left to provide the opportunity.
Gillingham were right back in the game two minutes after the break when Josh Parker fed the ball through to Wagstaff who, coming in from the right, smashed an angled drive past Bonham.
Hope was denied a hat-trick by the width of a post in the 81st minute when his shot from just inside the area left Tomas Holy beaten, but Miller made it 3-1 in added time, firing home after a goalmouth melee.