Nice have snatched fourth place and a spot in the Europa League with victory on a dramatic final day of Ligue 1 action.
Claude Puel's side needed all three points against Ajaccio to have any chance of catching Lille and Saint Etienne and made a bright start away from home.
Fabrice Abriel saw a header from close range go over the bar but ultimately Ajaccio were able to hold firm and keep the score level after 45 minutes.
Early in the second half Nice showed urgency and broke the deadlock, with lone striker Dario Cvitanich applying the finish from a tight angle.
Eric Bautheac went close soon after but the visitors were unable to to extend their advantage.
Ajaccio were searching for a point to secure survival and mounted a late response, with Mehdi Mostefa's shot from inside the penalty area deflected wide by a late block.
12 minutes from time Nice secured three precious points as Bautheac collected a clever pass from Thimothee Kolodzieczak before slotting home his side's second goal.
The hosts could not respond late on as Puel's men held firm to cap a fine campaign with European qualification against the odds.