England's Freddie Burns had to go off injured as Gloucester beat Mont de Marsan to secure home advantage for the next round of the Amlin Challenge Cup.
Burns left the field after kicking an early penalty, but Jonny May then went over for the game's first try.
Winger Charlie Sharples added another, but a converted try by Yann Brethous helped keep Mont de Marsan on terms.
Gloucester dominated the second period with two tries in four minutes by Henry Trinder before May added his second.
Billy Twelvetrees added the conversion, to go with two earlier penalties, as the Cherry and Whites secured their sixth win in the competition this season.
VIEWS FROM THE DRESSING ROOM
Gloucester director of rugby Nigel Davies told BBC Radio Gloucestershire:
"I'm very pleased with the fact that we're in a relatively difficult group, but we've come through to win all our matches and secured a home quarter-final which is vital for us.
"We haven't seen much of Jonny May or Henry Trinder this year. They're both back playing their second game and they bring something different to what we've had up until this point.
"Charlie Sharples is coming back into form, Sinbad's [James Simpson-Daniel] not far away and all of a sudden, we've got threats all over the field.
"Our attack worked very well for us and gave us the opportunities that we'd hoped it would. Our boys have got to work really hard for our attack structure to work."
"We felt a little bit of pressure at one point of the game and because of that, we weren't able to pull away from them in the first half, but the talk at half-time was about composure, not panicking, sticking with what works for us and the players did that."
M. Thomas; Sharples, Trinder, Molenaar, May; F. Burns, Robson; Wood, Britton, Knight, Hamilton, James, Savage, Qera, Kalamafoni.
Edmonds for Britton (50), Murphy for Wood (60), Chistolini for Knight (60), Buxton for Savage (71), Evans for Qera (66), Lewis for Robson (66), Twelvetrees for Burns (12), Monahan for James (75).
Mont de Marsan:
Durquet; Beaulavon, Lucu, Mchedlidze, Ryder; Claverie, Pic; Fiorini, Bordes, Mailau, De Chaves, Murray, Brethous, Farre, Ricaud.
Correia, Phelipponneau for Fiorini (31), Dos Santos for Ricaud (66), Lescure for Farre (41), Cabannes for Pic (41), Douvesy for Claverie (70), Duvallet for Durquet (70), Giudicelli for Mailau (48).
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.