John Akinde scored twice and also missed a penalty in Gillingham's hard-fought 2-0 victory over Bristol Rovers in Sky Bet League One.
Akinde opened the scoring in the 67th minute before he was denied from the spot by Rovers goalkeeper Joe Day soon after.
But the former Rovers striker bounced back to wrap up victory in stoppage time as the visitors suffered their first defeat under interim manager Tommy Widdrington.
Luke McCormick came within inches of opening the scoring for Rovers after 20 minutes when his curling free-kick crashed off the crossbar.
Former Gillingham striker Brandon Hanlan almost put Rovers ahead in controversial circumstances on the half-hour, as he ended a counterattack by firing against a post while the hosts were claiming a foul on Akinde at the other end of the pitch.
But it was the hosts who took the lead in the second half when Akinde beat the offside trap to meet Tom O'Connor's pass and slot past Day.
Akinde squandered the opportunity to seal his side's victory in the 73rd minute when his awful penalty - awarded after he had been fouled by Jack Baldwin - gave Day his second spot-kick save in a week.
However, the Gills striker belatedly scored his second of the game a minute into stoppage time after meeting Kyle Dempsey's neat cutback.