Gillingham recovered from a goal down to record victory over 10-man Blackpool at Priestfield.
Blackpool were the first to really threaten on 13 minutes when Peter Clarke's header had to be tipped over by Tony Bullock.
However, they were celebrating the first goal 10 minutes later. John Murphy knocked the ball down to Keigan Parker who, from a central position on the edge of the box, finished emphatically on the half volley.
Gillingham were denied a first-half equaliser by the woodwork in the 33rd minute. Andy Hessenthaler floated a left wing corner to Michael Flynn who let the ball bounce just inside the area and his swerving shot rebounded off the crossbar.
Gillingham found an equaliser though when captain Chris Hope directed a header into the top corner on 49 minutes before they scored what proved to be the winner in the 65th minute.
Blackpool only half cleared their lines, Paul Smith headed back in and Andrew Crofts headed across goal for Neil Harris to finish from close range.
Blackpool almost pulled themselves back on level terms two minutes later when Murphy's powerful header from Parker's right-wing corner was just inches wide of the target.
Blackpool's task became even more challenging on 77 minutes as Parker received a straight red card for an off the ball incident involving Tom Williams which left the Gills defender flat on the ground.
Gillingham almost rubbed salt into Blackpool's wounds with a third goal but Crofts' diving header whistled just wide.
Blackpool came close to having the last word through substitute Ian Morris whose curling 25-yard free-kick was palmed away by Bullock at full stretch.
The result moves Gillingham out of the relegation zone whereas Blackpool drop into the bottom four.