Troyes picked up only their second Ligue 1 win of the season this evening to move off the bottom of the table - but came close to throwing away the victory at the death.
Jean-Marc Furlan's side headed into the game having collected just nine points from 17 games, but raced into a three-goal interval lead thanks to strikes from Stephane Darbion, Benjamin Nivet and Fabien Camus at the Stade de l'Aube.
The visitors finally got going in the closing stages - pulling one back in the 89th minute through substitute Paul-Bastien Lasne and reducing the deficit further in stoppage time when Johan Cavalli's free-kick flew in off the head of Troyes defender Granddi Ngoyi - but they had left their charge too late.
Despite their lowly position, Troyes started brightly and should have taken a 17th-minute lead through Mounir Obbadi but he somehow fired wide from close range after a goalmouth scramble.
AJA's only real chance of the first half arrived in the 22nd minute, but Sigamary Diarra's 20-yard drive was kept out by home goalkeeper Yohann Thuram-Ulien.
From then on it was all Troyes before the break.
Jean-Christophe Bahebeck lashed inches wide just before the half-hour mark, before three goals in 13 minutes put the strugglers firmly in the ascendancy.
Nivet and Obbadi initiated a counter-attack which culminated in Camus flicking the ball to Darbion, who coolly slotted past Ajaccio goalkeeper Francisco Ochoa in the 33rd minute.
Five minutes later, Nivet pounced and sent the ball underneath the diving Ochoa after a poor defensive header from Samuel Bouhours.
And the home fans were celebrating again on the stroke of half-time when Nivet set up Camus, who despatched a right-footed curler into the top corner, leaving Ochoa motionless.
Troyes could have extended their advantage 10 minutes into the second half when Nivet fed teenage midfielder Corentin Jean, who rounded Ochoa only to see his shot cleared off the line by Bouhours.
Ajaccio looked to be struggling for inspiration, with Adrian Mutu's curling free-kick - parried by Thuram-Ulien - their best attempt until the late, late rally.
Substitute Lasne gave the visitors a glimmer of hope a minute from time when he capitalised on a mistake by defender Florian Jarjat and went on to beat Thuram-Ulien, and then Cavalli's goal-bound 92nd-minute free-kick found its way into the net via Ngoyi's head, but Troyes held on for a precious win.