Viktoria Plzen produced a grandstand finish to snatch a 2-2 against qualified AC Milan on Tuesday to secure third place in Champions League Group H and qualify for the Europa League.
A weakened Milan had looked to be cruising to victory after goals from Brazilian pair Pato and Robinho put them in the comfort zone.
But David Bystron struck a minute from the end and Michal Duris equalised three minutes into injury time to launch a party in Prague.
Milan, who were under the cosh for much of the game, finished the group second behind Barcelona.
Milan coach Massimiliano Allegri unsurprisingly made a raft of changes to the team, resting the likes of Zlatan Ibrahimovic, Kevin-Prince Boateng and Thiago Silva while France centre-back Philippe Mexes made his first start for the club.
Young right-back Mattia De Sciglio also made his full debut, his only other appearance being as a substitute when these two sides met at the San Siro.
It was no surprise that Milan were disjointed and it was the hosts who dominated the first period.
Milan Petrzela thrilled the home crowd by dribbling and feinting his way out of his own area before starting the move that saw Marek Bakos break clear of a high backline, only to leave the ball behind.
Vaclar Pilar produced an acrobatic bicycle kick from a corner but sent his shot high over the bar.
Frantisek Rajtoral then went on a mazy run, holding off Clarence Seedorf and skipping past De Sciglio with embarrassing ease but his finish was straight at Marco Amelia.
Marian Cisovsky was next to try his luck from a corner but his header went wide.
De Sciglio appeared out of his depth and Pilar left him for dead but shot into the side-netting.
Out of the blue Milan took the lead two minutes after the restart as Pato darted in to take Robinho's chested pass off a dallying Cisovsky before rounding Marek Cech and slotting into the empty net.
And a minute later another Cisovsky error from Seedorf's long punt saw Robinho rob him, play a one-two with Pato and then fire home into the top corner.
Milan were threatening to romp away with it and Pato lashed a shot past Cech at his near post only to see it come back off the upright.
Yet Plzen went straight up the other end and Petrzela cut inside Taye Taiwo and beat Amelia at his near post, the ball again coming off the woodwork and although Daniel Kolar netted the loose ball, he was offside.
Plzen continued gamely to push for a goal and Mexes had to redeem himself and deflect Rajtoral's shot wide after his own weak clearance had given the ball to the Viktoria player.
Milan felt comfortable enough to give 16-year-old midfielder Bryan Cristante, an Italy under-17 international, his debut although he had only 10 minutes.
Duris beat Amelia from distance but again the ball struck the post.
Yet a minute from time Bakos crossed for Bystron to score with a simple tap-in and then Duris burst into the area three minutes into injury time and fired home to snatch the most unlikely draw.