Legia Warsaw leapfrogged Sporting CP to qualify for the Europa League after beating their Portuguese visitors 1-0 in the final game of Champions League Group F.
Guilherme's first half strike was enough to keep the Polish champions in Europe after they had entertained spectators with swashbuckling efforts against Real Madrid and Borussia Dortmund.
It was a fully deserved victory for Legia and marked their first at this stage in the Champions League for 21 years.
But the result rounds off a disappointing campaign for Sporting who, despite enjoying the lion's share of the ball, struggled to create opportunities until the final minutes against a Legia side that had conceded 24 goals in their five previous group games.
William Carvalho was sent off late on to cap a miserable evening for Sporting, who must now focus their efforts on the fight for the Primeira Liga title.
It was a fittingly fast-paced opening to the game for Legia, whose five previous Group F fixtures had produced 32 goals.
Carvalho flashed a powerful drive narrowly wide for the visitors, before Legia's Aleksandar Prijovic was rightly flagged offside when he converted a right-wing cross from close range in the seventh minute.
Sporting dominated possession in the first half despite needing just a point to confirm Europa League qualification, but it was Legia, who scored a combined eight goals against Real Madrid and Borussia Dortmund, who posed the bigger threat on the counter.
Prijovic sprung the Sporting offside trap in the 28th minute but skewed his effort into the side netting when well placed to test Rui Patricio.
However, Legia did take the lead two minutes later through Guilherme, the Brazilian timed his run into the box perfectly to emerge ahead of Paulo Oliveira and poke home Prijovic's low cross past a wrong-footed Patricio at his near post.
The second half began in a similar pattern with Sporting struggling to breach the Legia defence, though Adrien Silva lashed wide when the ball fell fortuitously to him in the box in the 56th minute.
Sporting boss Jorge Jesus introduced Bryan Ruiz as his side cranked up the pressure, but Legia maintained a threat of their own. Thibault Moulin caught a volley sweetly directly from a corner but his strike from the edge of the box whistled past the post.
Bas Dost headed weakly wide in the 66th minute before forcing Legia goalkeeper Arkadiusz Malarz into a low save three minutes later.
Sporting's best chance came 16 minutes from time when substitute Andre got his feet in a tangle as he attempted to convert Gelson Martins' fizzing low cross from the right and sliced wide.
Michal Kucharczyk and Miroslav Radovic wasted glorious chances to seal it late on for the hosts as Sporting committed bodies forward, before Carvalho was shown a second yellow for a tug on Vadis Odjidja-Ofoe as Legia clung on to keep their European adventure alive