Boss Martin Allen got his Gillingham career off to a winning start away to Championship side Bristol City in the League Cup first round.
Danny Kedwell put the League Two club 1-0 up from the penalty spot at the end of the first half after City defender Liam Fontaine handballed.
Ben Strevens flicked home Charlie Allen's corner to double the lead.
Marvin Elliott headed home deep into added time, but it was no more than a consolation goal for the hosts.
VIEWS FROM THE DRESSING ROOM
Bristol City manager Derek McInnes told BBC Radio Bristol:
"I don't think Gillingham outplayed us but they certainly out-worked and out-fought us.
"Our performance for large spells was unacceptable and I feel Gillingham gained confidence from winning battles.
"It was bitterly disappointing; I'm not going to dress it up.
"Pre-season has firmly gone now and that result has smacked us between the eyes and we didn't see it coming."
Gillingham manager Martin Allen tells BBC Radio Kent:
"It was a great team effort to defend like that. I don't think our keeper had a save to make.
"With cup football, anything can happen and our squad has worked tremendously hard and none of them complained.
"It's not easy when you come away to a Championship club and you're going to get pressure but we defended as a team.
"It's not by luck. It's been hours of dedication. The players get rewards for their hard work and dedication."
Sorry, we were unable to load match stats, please try again.