MK Dons moved out of the bottom four courtesy of a dramatic 2-1 victory at Gillingham.
Chuks Aneke opened the scoring with a confident left-footed finish but Navid Nasseri equalised just before the break.
Dan Micciche’s side had a clear penalty appeal turned down in the second half but they weren’t to be deterred and George Williams popped up five minutes from time to win them a vital three points.
The Dons are now up to 20th in Sky Bet League One, two points clear of the bottom four.
Boss Micciche made one change to his starting XI, with the in-form Robbie Muirhead returning in place of Ethan Ebanks-Landell. There was a place on the bench for Scott Golbourne - his first appearance in the match day squad since undergoing hip surgery in January.
Gillingham made a fast start and it took a strong punch from Lee Nicholls to prevent Conor Wilkinson connecting with an early cross from Scott Wagstaff.
The Dons soon made their way up the other end and they were awarded a free-kick on the edge of the box for a foul on Aneke. Ed Upson took the set-piece but his curling effort was blocked by the wall.
On eight minutes, Robbie Muirhead came close to playing in Peter Pawlett. The Dons’ number 16 skipped away from his man however his through pass was out of Pawlett’s reach.
Aneke then set up Agard, whose right-footed attempt was blocked by a sliding defender. Williams flashed the loose ball wide.
Gillingham returned the pressure, earning a free-kick from which Nasseri sent a low drive well wide of goal. Later, a Wagstaff cross was just about dealt with by Nicholls despite Wilkinson getting a touch to the delivery.
Midway through the first half, Jake Hessenthaler was presented with a fantastic opportunity to open the scoring for the hosts. After latching onto Mark Byrne’s pass inside the area, the Gills midfielder only had Nicholls to beat but he directed his effort wide of the left post.
Micciche’s men fought back and a decent spell of possession deep inside the Gillingham half led to a chance for Upson who, from the edge of the area, was denied by a diving save from Tomas Holy.
With their next attempt at goal, on 33 minutes, they took the lead. Cisse flicked a header on for Agard who, in turn, found Aneke. The forward then drove into the box and beat Holy with a low left-footed shot into the far corner. 0-1.
The Dons kept their foot on the gas but weren’t able to extend their advantage. Then, with their first foray forward since conceding, Gillingham drew level courtesy of a far-post header from Nasseri, who sneaked round the back to connect with Bradley Garmston’s cross. 1-1.
Nasseri’s goal ensured both sides went into the break level.
Gillingham had the first attempt at breaking par at the start of the second period although Garmston’s drive never troubled Nicholls. Aneke came a lot closer six minutes into the half with a right-footed strike which Holy palmed away.
Micciche then made his first change of the evening, introducing Callum Brittain just 48 hours after he had represented England Under-20s in their 3-0 victory over Portugal.
He quickly got involved in the action and on 65 minutes he thought he had earned his side a penalty but, despite appearing to be fouled by a defender, was booked for simulation - much to the bemusement of the Dons players and fans.
The controversial decision seemed to spur Micciche’s side on and Upson soon came close to teeing up Aneke inside the area, only for the ball to run through to Holy.
Both sides were looking a threat on the attack and it took two excellent bits of defending from Elliott Ward and Muirhead to deny the Gills on two separate occasions, the latter clearing off the line from a deep cross.
That was Muirhead’s last involvement as he was replaced by Ebanks-Landell, in a switch which saw Lewington move to left wing-back.
With 15 minutes left to play, Byrne headed over for the Gills before his teammates Nasseri also missed the target with his head.
Micciche then used his final substitution to bring on Brandon Thomas-Asante in place of Agard and the young forward was involved right away, setting up Aneke for a clear run on goal. The Dons’ goalscorer was pulled down on his way through but, again to the surprise of most inside the stadium, Max Ehmer was not dismissed. Aneke curled over from the free-kick.
It looked for all the world like it wasn’t going to be the Dons’ day but on 85 minutes that all changed. Upson did brilliantly to drive forward with the ball before waiting patiently for the run of Williams. He picked him out with a low pass and Williams rewarded that play by getting to the ball first and getting a strong enough touch to send it past Holy and across the line. 1-2.
Starting XI: Nicholls; Wootton, Ward, Lewington (C); Williams, Pawlett (Brittain 53), Upson, Cisse, Muirhead (Ebanks-Landell 74); Aneke, Agard (Thomas-Asante 80).
Unused subs: Sietsma, Golbourne, Reo-Coker, Ugbo.
Goal: Aneke (33), Williams (85)
Booked: Pawlett, Brittain, Lewington, Aneke
Attendance: 5,540 (443 away)
Referee: J Busby