Brandon Hanlan secured Gillingham’s place in the FA Cup second round after Steve Evans’ side finally beat Sunderland 1-0 after extra-time in an all-League One replay.
Hanlan fired past Lee Burge in the 105th minute after a scrappy but competitive game to set up a home tie against Doncaster in round two.
Sunderland had the better of the early chances, with Laurens De Bock heading wide from Chris Maguire’s free-kick and Max Power testing Gills goalkeeper Jack Bonham with his cross-turned-shot, while Power should have done better with a long-range drive that flew over the bar.
Hanlan had the hosts’ best chances of the opening half, heading wide before his 20-yard attempt deflected off Alim Ozturk for a corner.
Will Grigg squandered Sunderland’s best chance to win the game in normal time, shooting to the left of Bonham’s post with 73 minutes gone after latching onto Aiden McGeady’s pass.
Gills captain Max Ehmer smashed a half-volley off the bar 13 minutes into extra-time before Hanlan met Olly Lee’s through ball to fire the hosts into round two for the third season running.