Deon Burton hit a stoppage-time winner to secure a 2-1 win over Morecambe and send Gillingham seven points clear at the top of League Two.
The Gills went ahead when Lewis Montrose rolled the ball into an empty net after an error from Barry Roche.
The Shrimpers looked to have secured a point when sub Jack Renshaw tapped in Kevin Ellison's low cross.
But veteran striker Burton controlled on his chest, swivelled and hit a half-volley past Roche from eight yards out.
VIEWS FROM THE DRESSING ROOM
Gillingham manager Martin Allen told BBC Radio Kent:
"What a goal, what a finish. I've seen him do that for years. It was an amazing end to a difficult game.
"Morecambe have been on good form. They're well organised with good men, proper men.
"It was a tough game and to come out of that with a win was fantastic. Never say never.
"In modern football your subs have to be powerful and quality and we have match winners on our bench. They all came on and did so well."