Match ends, Gillingham 3, Notts County 1.
Notts County crashed into League Two as three late goals from Gillingham condemned them to defeat.
The Magpies knew that a win would preserve their League One status and Graham Burke put them ahead from an acute angle in the 61st minute.
They looked to be safe but John Egan set nerves jangling again when he headed home two minutes from time.
Brennan Dickenson's curling shot put County behind before substitute Luke Norris hit the third to relegate them.
County had started the day outside the bottom four and missed several opportunities to make the game safe before their late collapse.
Gills goalkeeper Aaron Morris made a string of stops to keep them out - first superbly saving Garry Thompson's low effort and then making a double save to keep out Haydn Hollis and Jimmy Spencer just before half-time.
At the other end Bradley Dack's effort for Gillingham was cleared off the line.
The defeat meant Notts County ended the season with a run of just one victory in 13 games, which ultimately condemned them to League Two for the first time in five seasons.
Gillingham finished the season in 12th, after coming 17th in their first season back in League One in 2013-14.
Notts County manager Ricardo Moniz told BBC Radio Nottingham:
"It's a disaster, with five minutes to go and everything is in your own hands and we have given it away.
"It starts with a foul and the referee didn't give it, but we did it ourselves. We must defend better, we must mark better because we conceded too easily from set pieces.
"Words about next season are unnecessary at the minute. We are dead now and we will deal with the playing staff on Tuesday. Today is not the time to be talking about next season.
"This is a massive disappointment, I don't think the boys deserve this and it's a massive shock."
- 4EganBooked at 88mins
- 15MorrisSubstituted forNorrisat 70'minutes
- 10McDonaldSubstituted forFreiterat 90+4'minutes
- 5MullinsSubstituted forLitaat 90'minutes
- 3AdamsBooked at 50mins
- 24BurkeBooked at 61minsSubstituted forMcCourtat 72'minutesBooked at 90mins
- 9SpencerSubstituted forDumbuyaat 81'minutes
- Stuart Attwell
- Shots on Target
Second Half ends, Gillingham 3, Notts County 1.
Goal! Gillingham 3, Notts County 1. Luke Norris (Gillingham) right footed shot from the centre of the box to the bottom right corner. Assisted by Max Ehmer.
Substitution, Gillingham. Michael Freiter replaces Cody McDonald.
Goal! Gillingham 2, Notts County 1. Brennan Dickenson (Gillingham) right footed shot from the centre of the box to the bottom right corner following a set piece situation.
Paddy McCourt (Notts County) is shown the yellow card.
Bradley Dack (Gillingham) wins a free kick on the left wing.
Foul by Paddy McCourt (Notts County).
Corner, Gillingham. Conceded by Jordan Williams.
Attempt saved. John Marquis (Gillingham) right footed shot from outside the box is saved in the bottom right corner.
Substitution, Notts County. Leroy Lita replaces Hayden Mullins.
Goal! Gillingham 1, Notts County 1. John Egan (Gillingham) header from very close range to the top left corner. Assisted by Doug Loft with a cross.
John Marquis (Gillingham) wins a free kick in the defensive half.
Foul by Mustapha Dumbuya (Notts County).
Attempt saved. Balint Bajner (Notts County) right footed shot from the right side of the box is saved in the bottom right corner.
Attempt missed. Doug Loft (Gillingham) left footed shot from outside the box is close, but misses to the left.
Foul by Cody McDonald (Gillingham).
Roy Carroll (Notts County) wins a free kick in the attacking half.
Substitution, Notts County. Mustapha Dumbuya replaces James Spencer.
Attempt missed. John Marquis (Gillingham) right footed shot from outside the box is high and wide to the right from a direct free kick.