Sporting Lisbon beat 10-man Borussia Dortmund 3-1 on Wednesday with two goals from Pedro Goncalves to clinch their spot in the Champions League knockout stages for the first time in 13 years and eliminate the Germans from the competition.
Goncalves struck twice in the first half to lead his team to their 10th straight victory in all competitions and nine points in Group C, three ahead of the Germans with a game left and a better head-to-head, after losing 1-0 in Dortmund in September.
Sporting, in the round of 16 for the first time since 2008-09, made the most of a disastrous Nico Schulz clearance that sent the ball straight to Goncalves who flicked it past keeper Gregor Kobel after half an hour.
The midfielder, who also scored twice last week in their Portuguese Cup fourth-round win, rifled in from 20 metres nine minutes later to put Sporting firmly in the driving seat.
"We're in the round of 16 and it's great, it's good for the project, but we still have a lot to do," said Sporting coach Ruben Amorim.
"It was an incredible atmosphere, in a game where we knew how to take our moments. Pedro scored the goals but the others played a great game, gave everything.
"The team has grown and adapted. Today they played against a great team, which pushed us back. They played better than they did in Germany but we were also better."
Dortmund, still without injured striker Erling Haaland, came out fighting after the break, looking for a goal that would keep their qualifying hopes alive, and had an effort ruled offside but lacked precision in their final pass.
Their hopes of a comeback, however, were dashed when Emre Can was sent off in the 75th for a foul on Pedro Porro.
Sporting earned a penalty four minutes later and Porro headed in the rebound after Kobel had saved Goncalves' spot-kick to deny him a hat-trick.
Dortmund, who scored in stoppage-time through Donyell Malen, were left wondering how a campaign that started with two wins could have brought no points from the next three matches.
"We are discussing in the end about the same mistakes we keep making," Dortmund captain Marco Reus said. "Even with 10 we were better than Sporting were with 11 players. They did little but still won 3-1.
"We had the game under control until the 1-0. Then we allowed them to make it 2-0. It was a terrible evening. We are eliminated and that is the truth."
The Germans will go into the Europa League as the third-placed team in the group. Ajax Amsterdam clinched top spot with a 2-1 win over bottom side Besiktas, their fifth victory in five matches.