Harlequins’ perfect European Challenge Cup start came to an end as Montpellier scored five unanswered tries to join them in the quarter-finals.
Tries from Jesse Mogg and Wiaan Liebenberg helped put Montpellier up 15-9 at the break, with Quins’ points coming from the boot of Ben Botica.
Demetri Catrakilis kicked the French side further ahead after the break.
Quins Mat Luamanu was sin-binned before Nic White and Yvan Reilhac and Charles Geli tries sealed the bonus point win.
Victory sees Montpellier move into the last eight of the competition ahead of Cardiff Blues, whose big win over Italian side Calvisano was ultimately in vain.
Even before their trip to France for the final group game, Harlequins had done enough to top Pool Three and earn a home quarter-final.
Quins boss Connor O’Shea looked intent to make it six wins from six in the group stage of the competition, naming a side that included four of the six Harlequins players called up for the forthcoming Six Nations for the trip to Altrad Stadium.
Jack Clifford, Marland Yarde and Chris Robshaw started, while scrum-half Danny Care came off the bench with Quins 15-9 down, but failed to stop the hosts as they ran away with the game.
Montpellier: Mogg; Fall, Tuitavake, Ebersohn, O’Connor; Catrakilis, Paillaugue; Nariashvili, B. du Plessis, Jannie du Plessis, Tchale-Watchou, Willemse, Ouedraogo (capt), Liebenberg, Qera.
Replacements: Geli, Kubriashvili, Cilliers, Jacques du Plessis, Battut, White, Trinh-Duc, Reilhac.
Harlequins: Chisholm; Yarde, Hopper, Sloan, Walker; Botica, Dickson; Lambert, Gray, Collier, Merrick, Matthews, Robshaw, Wallace, Clifford (capt).
Replacements: Buchanan, Evans, Jones, Treadwell, Luamanu, Care, Swiel, Stanley.
For the latest rugby union news follow @bbcrugbyunion on Twitter.