IT really did look like Aidy Boothroyd’s England were going to pull off the impossible job - but then they were undone by an injury-time stunner.
The Young Lions thought they had done it through goals from Ebere Eze and Curtis Jones, with Portugal keeping up their part of the bargain by beating Switzerland.
But in the first minute of stoppage time, left-back Domagoj Bradaric unleashed a rocket from outside the area that flew into the back of the net to break hearts.
It sent Boothroyd’s men out on goal difference to the Croats, having lost their first two games to Switzerland and Portugal.
Jones was then sent off after clashing with England's celebrating rivals as a melee developed on the field.
The sickening result will likely be boss Boothroyd’s last in charge, with his contract up in the summer.
He had branded the Under-21s role the 'utterly impossible job' on Tuesday in how tough it is to juggle player progression with tournament success.
The ex-Watford boss has copped serious flak for his side’s performances in this tournament and rightly so.
But at least he can look back on a pride-salvaging final-game victory which for 15 minutes had looked like it would be enough.
England were handed the perfect start when Portugal took the lead against the Swiss after just three minutes 60 miles up the road in Ljubljana.
FREE BETS: GET OVER £2,000 IN SIGN UP OFFERS HERE
Jones, one of seven changes to come into the side, then rattled the crossbar.
Captain Eddie Nketiah was desperate to make an impact on this tournament after being the hottest goal-getter in Europe during qualification.
And it was he who won a 12th-minute penalty when Bartol Franjic trod on his foot, allowing Eze to stroke home the spot-kick.
The Croats were incensed and midfielder Luka Ivanusec was booked for dissent.
But they responded well and should have levelled up just after the half hour when Dario Spikic blazed over from 12 yards.
England have been their own worst enemy at times this season trying to play out from the back.
And again it almost cost them as Conor Gallagher lost it - but the West Brom loanee was bailed out by a strong hand by Aaron Ramsdale today Ivanusec.
Boothroyd’s men tried to push on after the break and Eze went close with a dangerous free-kick which keeper Dominik Kotarski pushed wide of his near post.
Most read in Football
Dwight McNeil came even closer as he cracked the post from a 25-yard set-piece, while Nketiah should have netted when played clean through.
The Portuguese did their part by putting the game between Switzerland, so it was down to England to see if they could grab a second and hold on.
Boothroyd threw on Brewster for Nketiah and the Sheffield United forward played his part in Jones’ crucial 74th-minute strike.
He smashed it across goal from out wide and the ball fell to McNeil, who kept his cool to lay back to Jones who found the corner brilliantly.
READ MORE SUN STORIES
Boothroyd roared in celebration on the touchline, believing his side had come back from the brink.
But they were undone at the last by Bradaric’s wonder strike, meaning they crashed out at the group stage for the fifth tournament in their last six.
⚽ Read our Football live blog for the very latest news from around the grounds