Jeff Hughes grabbed a late penalty to end Gillingham's resistance and earn Bristol Rovers victory in a game played in torrential rain and howling wind.
Hughes coolly placed his spot-kick beyond keeper Simon Royce after Matt Fry had been penalised for handball.
Chris Lines fired Rovers in front from 10 yards after 16 minutes but Andy Barcham drew the Gills level, curling home a right-footed shot from 25 yards.
Royce denied Danny Coles and Darryl Duffy but Hughes struck on 81 minutes.
Bristol Rovers manager Paul Trollope told BBC Radio Bristol:
"We had a good solidity about us after conceding so many goals in recent weeks - that was a major bonus.
"We found it difficult creating chances today. I think we forced them back in the first period and had the majority of the game.
"Once we managed to get Joe Kuffour in the game on a regular basis we managed to get on top and were worthy winners."
Gillingham manager Mark Stimson told BBC Radio Kent:
"After conceding really early on, I thought we did really well to get back into the game.
"I tried to encourage the boys to pass it more, but it didn't quite work out in the second half.
"I don't think we passed it anywhere near as well as we can."
90:00+4:37 The assistant referee signals for offside against Andrew Williams. Chris Palmer restarts play with the free kick.
90:00+2:27 Chris Palmer fouled by Andrew Williams, the ref awards a free kick. Chris Palmer crosses the ball from the free kick right-footed from left wing, Pat Baldwin manages to make a clearance.
90:00+2:08 Corner taken by Chris Palmer, clearance made by Byron Anthony.
90:00+1:55 Simeon Jackson takes a shot. Danny Coles gets a block in.
89:23 Booking Mark McCammon receives a caution.
89:16 Unfair challenge on Jeff Hughes by Mark McCammon results in a free kick. Jeff Hughes takes the free kick.
88:01 Substitution Mark Wright comes on in place of Jo Kuffour.
87:55 Chris Palmer produces a cross.
86:56 Centre by Chris Palmer, Danny Coles manages to make a clearance.
86:31 The ball is crossed by Chris Palmer, clearance by Byron Anthony.
86:01 Centre by Ben Swallow, clearance by Matt Fry.
85:17 Unfair challenge on Jeff Hughes by Mark McCammon results in a free kick. Mikkel Andersen takes the direct free kick.
85:06 Free kick awarded for an unfair challenge on Matt Fry by Jo Kuffour. Kevin Maher takes the direct free kick.
84:28 Inswinging corner taken left-footed by Chris Palmer played to the near post, clearance by Stuart Campbell.
84:22 The ball is crossed by Mark Bentley, clearance made by Danny Coles.
83:28 Chris Lines concedes a free kick for a foul on Kevin Maher. Mark Bentley takes the direct free kick.
81:02 Ben Swallow takes a shot from just outside the penalty area which clears the crossbar.
80:10 GOAL - Jeff Hughes:Bristol Rovers 2 - 1 Gillingham Placed penalty scored by Jeff Hughes. Bristol Rovers 2-1 Gillingham.
79:10 Matt Fry is penalised for handball and concedes a .
78:08 Substitution Mark McCammon comes on in place of Febian Brandy.
77:14 Free kick awarded for an unfair challenge on Jo Kuffour by Matt Fry. Free kick crossed right-footed by Stuart Campbell, Josh Gowling manages to make a clearance.
76:11 The ball is swung over by Barry Fuller, clearance made by Danny Coles.
74:38 Unfair challenge on Andy Barcham by Danny Coles results in a free kick. Free kick taken by Simon Royce.
74:05 Stuart Campbell takes the outswinging corner, clearance by Matt Fry.
73:51 Darryl Duffy takes a shot. Save by Simon Royce.
72:34 Unfair challenge on Stuart Campbell by Stuart Lewis results in a free kick.
72:34 Substitution Ben Swallow on for Dominic Blizzard.
70:06 Byron Anthony produces a cross.
69:12 The free kick is delivered left-footed by Jeff Hughes from left wing, Matt Fry makes a clearance.
69:12 Booking Josh Gowling goes into the book.
69:04 Josh Gowling concedes a free kick for a foul on Darryl Duffy.
66:34 Substitution Darryl Duffy replaces Chris Dickson.
65:31 Corner from the left by-line taken by Stuart Campbell, Kevin Maher manages to make a clearance.
65:21 A cross is delivered by Dominic Blizzard, Kevin Maher gets a block in.
64:15 Substitution Simeon Jackson joins the action as a substitute, replacing Curtis Weston.
64:15 Booking The referee shows Stuart Campbell a yellow card for unsporting behaviour.
63:57 Free kick awarded for an unfair challenge on Curtis Weston by Stuart Campbell. Chris Palmer takes the direct free kick.
62:00 Stuart Campbell crosses the ball in from the free kick, Curtis Weston makes a clearance.
62:00 Booking Matt Fry is cautioned.
61:53 Jo Kuffour fouled by Matt Fry, the ref awards a free kick.
61:11 Byron Anthony concedes a free kick for a foul on Febian Brandy. Free kick crossed right-footed by Kevin Maher from right channel, save by Mikkel Andersen.
60:35 Andrew Williams delivers the ball.
59:58 Chris Lines delivers the ball, clearance by Matt Fry.
59:44 The ball is sent over by Andrew Williams, Josh Gowling manages to make a clearance.
57:39 Barry Fuller delivers the ball, save by Mikkel Andersen.
56:50 Matt Fry fouled by Chris Dickson, the ref awards a free kick. Direct free kick taken by Simon Royce.
56:20 Centre by Dominic Blizzard, Andrew Williams produces a right-footed shot from just outside the penalty box that goes wide left of the target.
53:58 Free kick crossed by Chris Palmer, save by Mikkel Andersen.
53:58 Booking Jeff Hughes goes into the book.
53:53 Jeff Hughes challenges Febian Brandy unfairly and gives away a free kick.
53:12 Chris Lines takes a shot. Save by Simon Royce.
53:05 Chris Dickson sends in a cross.
52:00 Free kick awarded for an unfair challenge on Josh Gowling by Danny Coles. Free kick taken by Simon Royce.
50:14 Josh Gowling gives away a free kick for an unfair challenge on Chris Dickson. Free kick taken by Jeff Hughes.
Correction - 48:54 Matt Fry gives away a free kick for an unfair challenge on Chris Lines. Stuart Campbell crosses the ball from the free kick right-footed from right wing, clearance by Stuart Lewis.
48:54 Free kick awarded for an unfair challenge on Chris Lines by Matt Fry. Free kick crossed right-footed by Stuart Campbell.
46:46 The offside flag is raised against Chris Dickson. Simon Royce takes the indirect free kick.
45:59 Febian Brandy produces a cross.
45:01 The referee gets the second half underway.
Half Time
45:00+2:32 The first half comes to an end.
45:00+2:03 Unfair challenge on Byron Anthony by Febian Brandy results in a free kick. Stuart Campbell crosses the ball from the free kick right-footed from right wing, Josh Gowling manages to make a clearance.
45:00+0:47 Pat Baldwin delivers the ball.
45:00+0:14 Corner taken by Stuart Campbell from the left by-line, Mark Bentley manages to make a clearance.
45:00+0:02 Chris Lines takes a shot. Matt Fry gets a block in.
43:04 The assistant referee signals for offside against Chris Dickson. Indirect free kick taken by Barry Fuller.
39:59 Stuart Lewis provided the assist for the goal.
39:59 GOAL - Andy Barcham:Bristol Rovers 1 - 1 Gillingham A goal is scored by Andy Barcham from just outside the penalty area high into the middle of the goal. Bristol Rovers 1-1 Gillingham.
36:36 Free kick awarded for a foul by Chris Dickson on Kevin Maher. Simon Royce takes the free kick.
34:07 Unfair challenge on Kevin Maher by Stuart Campbell results in a free kick. Matt Fry takes the direct free kick.
32:01 Chris Dickson is flagged offside by the assistant referee. Simon Royce restarts play with the free kick.
31:11 Mark Bentley is flagged offside by the assistant referee. Mikkel Andersen takes the direct free kick.
30:05 Free kick awarded for an unfair challenge on Chris Palmer by Chris Dickson. Free kick taken by Chris Palmer.
27:17 Dominic Blizzard concedes a free kick for a foul on Barry Fuller. Free kick taken by Barry Fuller.
24:20 Shot from 20 yards by Curtis Weston. Save made by Mikkel Andersen.
24:13 The ball is swung over by Kevin Maher, clearance by Pat Baldwin.
23:41 Corner taken by Chris Palmer from the right by-line to the near post, Danny Coles makes a clearance.
23:31 The ball is swung over by Andy Barcham, Jeff Hughes manages to make a clearance.
20:57 The ball is delivered by Jeff Hughes.
19:58 Mark Bentley challenges Jeff Hughes unfairly and gives away a free kick. Jeff Hughes takes the direct free kick.
19:28 Dominic Blizzard delivers the ball.
18:37 Andy Barcham fouled by Chris Lines, the ref awards a free kick. Free kick crossed right-footed by Chris Palmer from left channel, Danny Coles makes a clearance.
17:58 Febian Brandy fouled by Danny Coles, the ref awards a free kick. Free kick crossed left-footed by Chris Palmer from right wing, Byron Anthony makes a clearance.
16:55 Assist by Dominic Blizzard.
16:55 GOAL - Chris Lines:Bristol Rovers 1 - 0 Gillingham Chris Lines fires in a goal from deep inside the penalty box to the bottom right corner of the goal. Bristol Rovers 1-0 Gillingham.
16:14 Kevin Maher gives away a free kick for an unfair challenge on Chris Lines. Free kick taken by Stuart Campbell.
10:58 Unfair challenge on Febian Brandy by Chris Lines results in a free kick. Josh Gowling restarts play with the free kick.
10:04 Chris Palmer has shot on goal from a long way out that goes wide left.
9:22 Jeff Hughes concedes a free kick for a foul on Mark Bentley. Free kick taken by Barry Fuller.
8:56 A cross is delivered by Jo Kuffour.
6:04 Pat Baldwin challenges Stuart Lewis unfairly and gives away a free kick. Free kick crossed right-footed by Chris Palmer from left wing, Mikkel Andersen makes a save.
5:31 The ball is delivered by Chris Palmer, clearance by Danny Coles.
4:19 Danny Coles takes a long range shot harmlessly clearing the crossbar.
3:58 Foul by Chris Palmer on Andrew Williams, free kick awarded. Free kick crossed by Stuart Campbell, Stuart Lewis makes a clearance.
1:42 Dominic Blizzard produces a cross, Josh Gowling makes a clearance.
1:24 The ball is sent over by Andrew Williams, clearance by Kevin Maher.
0:17 Barry Fuller delivers the ball, Danny Coles makes a clearance.
0:00 The match gets underway.
Live text and data provided by The Press Association.
Bookmark with:
What are these?