Portsmouth’s unbeaten start to the League One season came to an end after a wonder goal from Tom Eaves set Gillingham on their way to a shock 2-0 win at Fratton Park.
Alex Lacey also found the net as the Gills secured their first victory since 11 August.
The Gills went ahead through Eaves in the 26th minute after he controlled the ball on his chest in the box before turning and smashing his effort into the back of the net.
The visitors then doubled their advantage on the stroke of half-time as Pompey switched off at a low corner that Lacey fired in.
Pompey came out strongly after the interval and a goalmouth scramble in the 49th minute resulted in Jamal Lowe having his shot blocked.
The hosts continued to throw everything at Gillingham’s penalty area and Lee Brown looked to have found Brett Pitman lurking in space, but defender Luke O’Neill headed away.
The win sees Steve Lovell’s side climb out of the League One bottom four, up to 19th place and they now face Tottenham Hotspur in the Checkatrade Trophy at The Valley on Tuesday night before returning to league action on Saturday as they entertain Southend United.
Portsmouth line up: MacGillivray, Brown, Clarke, Whatmough, Naylor, N Thompson (Hawkins 75), Evans (Wheeler H/T), Close (B Thompson H/T), Curtis, Pitman, Lowe.
Subs not used: McGee, Walkes, Burgess, Mason.
Gillingham line up: Holy, O’Neill, Fuller, Ehmer, Zakuani, Lacey, Reilly, Byrne, Parrett, Eaves, Hanlan (List 79).
Subs not used: Hadler, Garmston, Parker, Nasseri, Simpson, Rees.
Goals: Eaves (26), Lacey (45+2).
Referee: Mr Chris Sarginson.
Attendance: 18,158 (542 Gills)
Picture supplied by Kent Pro Images.