The win gives Ajaccio a huge relief from the snares of relegation, moving them up to 15th place in the 20 team league. Both teams finished with ten men after a player from each side was handed a straight red card.
Ajaccio were reduced to ten men in the 47th minute after Fousseni Diawara was given his matching orders for a foul on Souleymane Camara inside the box. However, Younnes Belhanda failed to drive the resultant penalty home as AC Ajaccio custodian Guillermo Ochoa made a great save.
However, Anthony Mounier gave Montepellier the lead in the 57th minute finishing off a great counter attack from Bedimo Henry.
Ajaccio would then give a fight in the final 15 minutes of the match, knowing the importance of the three points.
In the 80th minute, Montpellier were also reduced to ten men after Abdelhamid El-Kaoutari was shown red for a foul on Andy Delort inside the box. Delort took the penalty himself and he scored to tie the scores at 1-1.
Delort would then turn provider for a dramatic finish to the game, Oliech rising high to connect to his cross and give Ajjaccio the winner.
Ajaccio now have 38 points, four ahead of the bottom three. Schaux, Stade Brestois 29 and Esperance Sportive occupy the last three positions in the Ligue one table led by money bags Paris St Germain who are on 70 points.