A last-gasp strike from Domagoj Bradaric denied England men's under-21s a place in the UEFA European Championship quarter-finals as the Young Lions bowed out on head-to-head goal difference despite beating Croatia by 2-1.
England, who needed to win by two or more goals and hope Portugal beat Switzerland elsewhere in Group D, were on the brink of the knockout stages heading into injury time after Curtis Jones had doubled an advantage given to them by Eberechi Eze's 11th-minute penalty.
But Bradaric took aim from 25 yards and picked out the top corner to seal Croatia's qualification at the expense of Aidy Boothroyd's side, who hit the woodwork twice in a largely dominant display.
Croatia will now meet Spain in the quarter-finals in Maribor when the teams return to Hungary and Slovenia on 31 May.
UEFA European Under-21 Championship
Croatia MU21s v England MU21s
Wednesday 31 March 2021
Boothroyd made seven changes from the side beaten by Portugal on Sunday, with Aaron Ramsdale, Japhet Tanganga, Oliver Skipp and Eddie Nketiah the only players to keep their places in the starting XI.
England's hopes were boosted when Portugal took a third-minute lead against Switzerland and the Young Lions began on the front foot themselves, coming close to breaking the deadlock nine minutes in.
A short corner found Jones, who curled a fine effort from the edge of the area which hit the top of the crossbar on its way over.
The same player soon latched on to Lloyd Kelly's excellent pass to set up Conor Gallagher, whose shot was blocked, and England were given the perfect chance to make their early pressure count when Nketiah was bundled over by Bartol Franjic.
Referee Harm Osmers pointed to the spot and Eze kept his cool to send Dominik Kotarski the wrong way and roll a nerveless penalty into the bottom corner for England's first goal of the tournament.
Croatia, managed by former Liverpool midfielder Igor Biscan, grew into the contest as the first half wore on and spurned a gilt-edged chance to level when Nikola Moro's cutback found Dario Spikic, who blazed over from eight yards.
Ramsdale then came to the Young Lions' rescue on 37 minutes, diving to his right to superbly deny Luka Ivanusec after the midfielder had picked Gallagher's pocket and advanced through on goal.
Jones fired wide at the other end as both sides continued to create chances but there were no further additions to the scoreline before the half-time whistle.
England knew they needed to add to their lead in the second half to keep their quarter-final hopes alive and immediately signalled their intent when Eze saw a free-kick well saved by Kotarski to his left.
The one-way traffic continued as Tanganga headed over, Jones' long-range effort was deflected narrowly wide and Nketiah fired a presentable opportunity straight at Kotarski following fine work by Skipp and Eze.
Just past the hour mark, the woodwork denied England once more and this time Dwight McNeil was the unfortunate party, striking the outside of the post with an excellent free-kick.
Kristijan Bistrovic came close with a free-kick of his own, kept out by Ramsdale, as Croatia provided a reminder as to their threat.
Boothroyd made a double substitution in the 71st minute and one of the players he introduced, Rhian Brewster, played a key part in what looked like being a decisive second goal.
The forward's cross found McNeil, who laid the ball back for Jones to fire an unstoppable drive into the bottom corner and put England's destiny in their own hands.
With Portugal comfortably in front against Switzerland by this stage, Croatia knew a goal would secure their own progress and pushed forward in the final 15 minutes without creating a clear-cut opening.
But there was a late sting in the tail for the Young Lions as Bradaric let fly with a screamer which arrowed into the top corner in the first minute of added time.
The strike sent England from second to fourth in Group D and the Young Lions could not muster a response in the time remaining, Tanganga's 30-yard effort flying harmlessly over in the final act of an exhilarating contest which had a cruel ending for Boothroyd's men.
England (4-3-3): 1 Aaron Ramsdale (Sheffield United); 2 Max Aarons (Norwich City), 15 Japhet Tanganga (Tottenham Hotspur), 12 Ben Wilmot (Watford), 3 Lloyd Kelly (AFC Bournemouth); 8 Conor Gallagher (West Bromwich Albion, on loan from Chelsea), 16 Oliver Skipp (Norwich City, on loan from Tottenham Hotspur), 20 Eberechi Eze (Crystal Palace); 17 Curtis Jones (Liverpool), 9 Eddie Nketiah (Arsenal), 21 Dwight McNeil (Burnley)
Substitutes: 7 Todd Cantwell (Norwich City) for Gallagher 72', 19 Rhian Brewster (Sheffield United) for Nketiah 72', 14 Steven Sessegnon (Bristol City, on loan from Fulham) for McNeil 89'
Substitutes not used: 11 Ryan Sessegnon (Tottenham Hotspur), 13 Joe Bursik (Stoke City), 22 Josh Griffiths (Cheltenham Town, on loan from West Bromwich Albion), 23 Noni Madueke (PSV Eindhoven)
Bookings: Kelly 45', Jones 48', Skipp 90'
Goals: Eze 12', Jones 74'
Croatia (4-2-3-1): 12 Dominik Kotarski, 2 Marin Sverko, 22 Mario Vuskovic, 16 Bartol Franjic, 11 Domagoj Bradaric; 8 Nikola Moro, 3 Hrvoje Babec; 7 Luka Ivanusec, 21 Dario Spikic, 17 Kristijan Bistrovic; 14 Dario Vizinger
Substitutes: 13 Mihael Zaper for Babec 64', 4 David Colina for Spikic 64', 10 Lovro Majer for Bistrovic 76'
Substitutes not used: 1 Adrian Semper, 5 Martin Erlic, 6 Darko Nejasmic, 9 Sandro Kulenovic, 15 Kresimir Krizmanic, 18 Marko Divkovic, 19 Matej Vuk, 20 Petar Musa, 23 Ivan Nevistic
Bookings: Ivanusec 11', Bradaric 45', Spikic 62', Zaper 87'
Goals: Bradaric 90+1'
Referee: Harm Osmers