A 2-2 draw at Chesterfield was not enough for Manchester City U21s to progress from the Checkatrade Trophy group stage.
The young Blues needed a win to progress but were denied by Chris O'Grady's 97th minute equaliser after an action-packed finale.
A stunning free kick from Ed Francis and Lukas Nmecha's close range finish two minutes from time saw City come back from a goal down with 10 men after Charlie Oliver saw red for his tackle on Andy Kellett.
Joe Rowley had put the League 2 side ahead in the 74 minute with a well-placed header as the game sprang to life in the final 15 minutes.
As competition rules dictate, a penalty shoot-out followed, with a bonus point up for grabs for the winners.
Nmecha, Francis and Taylor Richards all scored for City, but Demeaco Duhaney saw his effort saved and Tyreke Wilson fired wide, giving the Spireites a 4-3 shoot-out victory.