CSKA Moscow completed a shock double over Real Madrid by winning 3-0 at the Santiago Bernabeu on Thursday (AEDT), but it was not enough to earn them a place in the Europa League.
The Champions League holders had been beaten 1-0 in the Russian capital earlier in their Group G campaign, yet they were already assured of going through as group winners.
Their visitors, meanwhile, needed to pick up more points than Viktoria Plzen to prolong their European interest, but were denied by a 2-1 win for the Czech side over Roma.
Fedor Chalov, Georgy Schennikov and Arnor Sigurdsson scored the goals for CSKA on a humiliating night for Madrid, who were subjected to whistles from the home fans at full-time.
It was a much-changed Madrid side who dominated possession in the early stages, but they found goalscoring opportunities limited, with Marco Asensio seeing a tame low strike comfortably saved by goalkeeper Igor Akinfeev.
Asensio started to prove a nuisance for the CSKA defence and, having earlier clipped the crossbar with a curling strike, saw another effort tipped over before squandering a golden opportunity to break the deadlock when he was sent through one-on-one with Akinfeev.
When the opener arrived in the 37th minute, it was completely against the run of play.
Sigurdsson carried the ball goalwards before offloading to Chalov on the edge of the box, the striker steadying himself before placing a shot beyond the reach of the diving Thibaut Courtois.
That lead was doubled to the bemusement of Madrid fans six minutes later, when a Mario Fernandes shot bounced off Courtois and Schennikov raced into the box to finish the job.
Madrid launched a rapid counter-attack 10 minutes into the second half, but Isco's dithering allowed Schennikov to recover from his first attempt at a tackle to block the attacker's eventual strike.
And the points were in the bag for CSKA after 73 minutes, when Sigurdsson swept home from the edge of the box to complete a most unlikely victory.
What does it mean? CSKA complete rare double
The result had no impact on Madrid's topping of Group G but it did mark the first time they have lost twice to the same team in the group stage of the Champions League since they were beaten home and away by Juventus in 2008-09.
A further point of concern for Madrid will be an ankle knock to Gareth Bale. The Welshman came on as a half-time substitute for Karim Benzema and, while he was deemed fit enough to continue after picking up the injury, he did require lengthy treatment.
Isco can't catch a break
With the exception of last week's Copa del Rey clash with Melilla, this was Isco's first start since October, with the attacker having fallen out of favour since Santiago Solari took over from Julen Lopetegui.
The Spain international did little to enhance his case for a regular spot in the starting XI on Thursday, giving away possession too cheaply and not making the most of his chances when they arrived.
Sigurdsson sets the standard
CSKA's strength was in taking their chances. From five shots on target, they scored three goals.
Sigurdsson was central to two of those strikes, embarking on the run that would set up Chalov for the opener, before rounding off the win with a confident finish.
Real Madrid host Rayo Vallecano in La Liga on Sunday, while CSKA are not back in action until March.