Eintracht Frankfurt stunned Barcelona with a dramatic victory at the Nou Camp to set up a Europa League semi-final against West Ham.
After the first leg had finished 1-1, the German side stormed into a 3-0 lead in the second and looked in control before two late goals for Barcelona.
Filip Kostic’s penalty and Rafael Borre’s superb strike were followed by another for Kostic after the break.
But Sergio Busquets’ effort and Memphis Depay’s penalty set up a tense finish.
Frankfurt defender Evan Ndicka was also sent off for a second yellow card for what looked a soft foul on Luuk de Jong for the spot-kick, with nine minutes added on following a VAR malfunction.
But Frankfurt, who sit ninth in the Bundesliga and won this competition in its previous guise in 1980, saw out a memorable victory to the delight of their almost 30,000 travelling fans.
After the match, Barcelona manager Xavi was critical of the fact that so many away fans were able to gain access to the stadium.
Barcelona president Joan Laporta told his club’s television channel: “Frankly what happened makes me feel embarrassed and ashamed. There were many fans of the other team and not many of ours.
“I’m very sorry for what has happened.
“What we can avoid are certain situations but as of now, we will have to be much more strict. We can’t allow these situations to happen.”
Barcelona, on a superb run since the arrival of Xavi as manager, did not know how to cope with the Bundesliga outfit’s clinical counter-attacks and Frankfurt could have had more.
Xavi called the situation regarding the fans a “miscalculation” as his side had a 15-game unbeaten run ended.
“I’ve tried to tell the players that the important thing is what happens on the pitch, but logically this could have affected us. It’s very clear,” said the Barcelona boss.
“We’ve tried to focus on the game and we’ve not been good. It has nothing to do with one thing and the other. It’s not an excuse.
“It hasn’t helped us, but on the pitch, we haven’t been good, and we haven’t competed.”
Frankfurt’s Kostic slotted the first from the spot following a foul by Eric Garcia but the goal of the game came from Borre, who thundered a strike into the roof of the net from distance.
The hosts had chances of their own and Pierre-Emerick Aubameyang headed over in the first half before failing to connect with Ousmane Dembele’s low cross in the second.
Busquets saw an initial effort ruled out for offside in added time before sparking a dramatic finish with a well-taken goal, but the hosts ran out of time after Depay’s penalty just crept over the line.
It means Frankfurt can look forward to a semi-final against David Moyes’ Hammers.