Notts County have been relegated from League One after two goals in the dying minutes saw Gillingham snatch a 3-1 victory at the Priestfield Stadium.
Graham Burke's unstoppable second-half strike looked to have steered Notts County out of the relegation zone on the final day of the season.
However, strikes from John Egan and Brennan Dickenson gave the Gills victory and left the Magpies in the bottom four as results went against them elsewhere.
County had withstand plenty of early pressure, with Roy Carroll producing saves to keep out Cody McDonald and John Marquis.
Carroll was beaten late in the first half when Bradley Dack rounded the Northern Irishman, but his goal-bound effort was cleared off the line by Gary Jones.
The Magpies gave themselves hope of surviving the drop when Burke put the visitors ahead.
A quickly-taken free kick from Liam Noble found Burke in space and, from a tight angle, the midfielder unleashed a rocket of shot that beat Glenn Morris and saw County edge closer to securing their place in the third tier of English football.
However, those hopes suffered a setback when Egan bundled the ball home following a goalmouth scramble in the 88th minute.
The Gills then took the lead in the third minute of injury time when Dickenson fired home.
As County committed players forward in a bid to get back into the game, a break from Norris saw the forward score Gillingham's third as the Magpies fell two points short of safety.