Free-scoring Gillingham knocked higher division opponents Bournemouth out of the FA Cup in the first round replay.
Curtis Weston's 30-yard strike put the League Two Gills ahead, but Bournemouth drew level when Andy Frampton steered a Scott Malone cross into his own net.
Garry Richards restored the home side's advatage, bundling home after Charlie Lee's pass, before Stefan Payne lashed home to seal the win.
Harry Arter grabbed a consolation for the visitors with a 30-yard free-kick.
The Gills will now visit Leyton Orient in the second round on 3 December.
VIEWS FROM THE DRESSING ROOM
Gillingham boss Andy Hessenthaler told BBC Radio Kent:
"Over the 90 minutes I thought we deserved to win the game. For the first half an hour we were terrific.
"The only criticism of the boys is that we let them off the hook a little bit in that spell. We perhaps should have got another goal.
"We kept plugging away and I always felt we had enough in the team to create chances. That just shows you the character we've got."
Bournemouth manager Lee Bradbury told BBC Radio Solent:
"For the first half we were nowhere near at the races. We came out and gave it a really good go in the second half, but it was too late. We've got to turn up for 90 minutes. Inconsistency has been our failure this season.
"We got a foothold in the game and I thought maybe we'd go on and win it, but they were resilient tonight and played well.
"They deserved to win the game after 90 minutes."