Connacht produced a superb defensive performance to record another victory on French soil and in the process give themselves a great chance of reaching the quarter-finals of the Amlin Challenge Cup.
Two tries from winger Fionn Carr in each half paved the way as Michael Bradley's men came from ten points down at one stage in the opening half.
Argentine international Frederico Todeschini gave Montpellier an early advantage with a drop goal from in front of the posts after less than two minutes.
Miah Nikora cancelled that at the other end with a penalty from the left on the 22 four minutes later and Connacht enjoyed a lengthy spell on the offensive but were unable to punish the French.
Todeschini extended Montpellier's lead with a 35 metre penalty after 16 minutes and better was to follow for them when Ollie Smith scored the opening try which Todeschini converted.
The pressure finally paid off five minutes from the break when Carr cut an excellent line to break through for a try which Nikora converted to leave it 13-10.
Todeschini extended Montpellier's lead just before the break with another penalty. But Keith Matthews made a superb break for interval substitute Ian Keatley to send Carr over for his second try four minutes after the restart.
Keatley landed the touchline conversion for Connacht to lead for the first time in the game but their 17-16 advantage was quickly as Todeschini landed another penalty after 47 minutes.
But that was to be Montpellier's final score and the crucial score came after 59 minutes when Connacht opened the home defence with a swift move from the right which finished with Keatley putting Niva Ta'auso over.