Glasgow Warriors claimed their second win in Heineken Cup Pool Three as Montpellier were beaten at Firhill.
Eric Escande crossed the line for the French side as the match neared the half-hour mark but Duncan Weir kicked the hosts into a 12-10 half-time lead.
Ruaridh Jackson kicked the Warriors further ahead and Federico Aramburu's try put them well in control.
However, Sakiusa Matadigo's late try ensured a bonus point for Montpellier, who host Glasgow on Saturday.
Sean Lineen's side move up to second in Pool Three, three points behind Leinster, who beat Bath 18-13. Montpellier remain bottom, two points adrift off Bath and four behind Glasgow.
The visitors, without Fulgence Ouedraogo, Mamuka Gorgodze and Francois Trinh-Duc, were reduced to 14 men early on as Pierre Berard was sin-binned for taking Aramburu out in the air and Glasgow soon moved ahead through Weir's opening penalty.
But the hosts, who included recent signing Rory Lamont in their line-up, were penalised for not rolling away and Martin Bustos Moyana kicked Montpellier level as Berard returned to the fray.
Weir's second penalty attempt skewed wide but an offside offence gave the fly-half the chance to atone for that miss and he duly obliged, to the delight of the home fans.
Montpellier began to press and a ruck right on the Glasgow try-line led to a series of scrums and Glasgow's Jon Welsh became the second player yellow-carded after continuing to infringe.
Ryan Wilson was replaced by Ryan Grant to strengthen the hosts' back row but continued scrummage pressure from the French side produced the game's first try, Escande touching down at the second attempt and Bustos Moyana converting.
Weir was successful with a penalty from halfway to bring the Warriors back to within a point.
Vassili Bost joined Welsh in the sin bin following his challenge on John Barclay at a line-out and another massive kick by Weir from the resulting penalty put Glasgow back in front.
Weir pulled his next attempt wide at the start of the second half and there was more frustration for the home crowd when Escande tackled Richie Gray as he galloped towards the try-line.
Another Warriors charge, this time led by Stuart Hogg, broke down with a knock-on and the full-back's next lung-bursting run was halted by another timely Escande challenge.
Weir was replaced by Jackson and his first penalty sailed superbly through the posts to stretch Glasgow's advantage.
It was from a scrum on the left that Glasgow got their try, with the ball recycled through Chris Cusiter, Jackson and the impressive Hogg to Aramburu, who raced through to touch down in the right-hand corner.
Jackson's conversion attempt was wide but Aramburu almost crossed the line again moments later after stealing possession deep inside the Montpellier half.
The French side survived that break and rallied to release Matadigo to run in a try on the right, Bustos Moyana missing the conversion in added time.
Glasgow: Hogg, Aramburu, Murchie, Morrison, Lamont, Weir, Cusiter, Welsh, MacArthur, Cusack, R. Grant, Kellock, Harley, Barclay, R. Wilson, R. Wilson.
Replacements: Jackson for Weir (57), R. Grant for Welsh (53), Hall for MacArthur (66), Kalman for Cusack (66), Fusaro for R. Wilson (57), Fusaro for R. Wilson (57). Not Used: Ryder, Pyrgos, Nathan.
Sin Bin: Welsh (27).
Montpellier: Peyras-Loustalet, Berard, Bosch, Combezou, Bustos, Fernandez, Escande, Shvelidze, Ladhuie, Jgenti, Tuineau, Hancke, Bost, Martain, Tulou.
Replacements: Gonzalez Amorosino for Berard (66), Perraux for Fernandez (75), Paillaugue for Escande (66), Nariashvili for Shvelidze (66), Caudullo for Ladhuie (68), Kervarec for Jgenti (75), Galletier for Bost (75), Matadigo for Tulou (66).
Sin Bin: Berard (8), Bost (35).
Ref: Greg Garner (RFU).