Zenit St Petersburg lost 4-1 at Austria Vienna but reached the UEFA Champions League knockout phase due to Porto's loss at Atletico Madrid.
The Russian side required victory to progress from Group G without relying on the outcome in the Spanish capital and Aleksandr Kerzhakov put them on course to do just that with the opener in the 35th minute.
However, Vienna scored three goals – two courtesy of Philipp Hosiner – within seven minutes either side of the break to leave Zenit facing an anxious wait before Roman Kienast added a fourth late on.
Porto were unable to recover a first-half deficit, resigning them to UEFA Europa League football and sending Zenit through to the Champions League round of 16 with only six points from six games.
Vienna, who were guaranteed to finish bottom before kick-off, celebrated their first win in Europe's elite competition, with Tomas Jun also on target.
The home side were without defender Lukas Rotpuller and midfielder Bernhard Luxbacher due to injury, while playmaker Danny missed out for Zenit.
That did not prevent the Russian heavyweights creating chances in an opening half hour they dominated.
Within 180 seconds, Hulk fired over the crossbar following a neat passing move. Domenico Criscito was then close to connecting with a Viktor Fayzulin cross, before Hulk created space for himself with some delightful footwork only to see his shot from the edge of the box blocked by Kaja Rogulj.
Zenit eventually broke the deadlock in the 35th minute. Kerzhakov's clever movement coupled with defender Manuel Ortlechner's untimely slip allowed the former to race on to Hulk's reverse throughball. Kerzhakov took it round goalkeeper Heinz Lindner and slotted home into the empty net.
Out of nothing, however, Vienna equalised on the stroke of half-time. Hosiner robbed Zenit of possession, played a superb one-two with Marko Stankovic and slotted the ball across goalkeeper Yuri Lodygin and into the bottom corner.
Within six minutes of the restart, Vienna were 3-1 up. First, following a very poor goal-kick from Lodygin, Markus Suttner controlled the ball sublimely and crossed to give Jun a tap-in.
Then Florian Mader's long-range strike was parried by Lodygin straight into the path of Hosiner, who thumped the ball home to complete his brace.
Zenit tried to respond as Konstantin Zyryanov went close from distance, Hulk forced Lindner into a smart save and Axel Witsel saw his powerful strike go narrowly over the crossbar.
But Vienna completed a 4-1 success in injury time, when the brilliant Hosiner crossed for substitute Kienast to fire home.
|16||P. Hosiner||44' 51'|
|Coach: N. Bjelica|
for T. Murg 60'
for M. Stanković 68'
for T. Jun 83'
|Milan on right track - Inzaghi|
|Estoril 1 Vitoria Guimaraes 0: Kleber checks visitors´ momentum|
|Eredivisie Review: PSV in Eagles demolition, AZ downed at home|
|Garcia fumes at missed handball|
|Serie A Review: 10-man Milan frustrate Roma, Cesena rescue point|
|Roma 0 Milan 0: Hosts denied despite Armero red|
|Ligue 1 Review: PSG held at home, Monaco claim fourth win in a row|
|Bundesliga Review: Bremen off bottom with Dortmund win, Augsburg beat Gladbach|
|Blanc frustrated after drab stalemate|
|League Two Review: Moore´s Hartlepool tenure begins with draw|
|Championship Review: Blackpool hit for six, Middlesbrough slip up|
|Luis Enrique enjoying Pedro´s resurgence|
|Scottish Premiership Review: Aberdeen move to second, St Mirren misery continues|
|Koeman delighted with clinical Southampton|
|Pochettino tips in-form Kane for England call-up|
|Dortmund are ´idiots´ - Klopp|
|Allardyce hails ´outstanding´ Downing|
|Young admitted fault after Agbonlahor dismissal, says Lambert|
|Pearson not concerned with speculation|
|Bruce: Hull simply not good enough|
|Everton must improve - Martinez|
|Irvine rues sloppy defending|
|Cruz Azul 1 Auckland City 1 (2-4 on pens): Plucky New Zealanders claim third|
|Austin an example for young strikers - Redknapp|
|Dyche takes pride in White Hart Lane defeat|
|Arabian Gulf League Review: Al Shabab strike late to sink Al Dhafra, top two win|
|Swansea win vindicated changes, says Monk|
|Van Gaal frustrated by dropped points at Villa|
|Paris Saint-Germain 0 Montpellier 0: Champions frustrated by Courbis´ men|
|League One Review: Wilson gains landmark win as Bristol City and Swindon falter|
|Hull City 0 Swansea City 1: Monk´s men celebrate rare away win|
|Southampton 3 Everton 0: Koeman´s side back to winning ways|
|Aston Villa 1 Manchester United 1: Visitors held despite Agbonlahor dismissal|
|QPR 3 West Brom 2: Austin treble lifts hosts out of drop zone|
|Barcelona 5 Cordoba 0: Suarez opens Liga account in emphatic win|
|Tottenham 2 Burnley 1: Lamela stunner wins it for Spurs|
|West Ham 2 Leicester City 0: Carroll, Downing seal the points|
|Werder Bremen 2 Borussia Dortmund 1: Hosts off the bottom by adding to Klopp´s woes|
|Kerala Blasters 0 Atletico de Kolkata 1: Last-gasp Rafique seals inaugural title|
|Warnock fumes over disallowed goal|
|Pellegrini hails Silva quality|
|Betis announce Mel return|
|Huntelaar signs Schalke extension|
|Juventus v Napoli: Allegri backs Tevez to make difference|
|Stoke City v Chelsea: Mourinho calls for adaptability|
|Manchester City 3 Crystal Palace 0: Silva strikes twice as champions go joint-top|
|A-League Review: City snatch Melbourne derby honours, Glory pull further clear|
|Mancini: Inter can finish third|
|Sterling revels in Golden Boy award|
|Pellegrini: You never win a title in December|
|Rodgers bemoans Sanchez snub|
|Ayew confident Marseille can beat title rivals|
|Mercier: San Lorenzo won´t roll over to Real Madrid|
|Lukaku: I´m still 21|
|Mainz bemoan ´tragic´ loss to Bayern|
|Rojo ruled out for Villa trip|
|Lopetegui thrilled with Porto response|
|Guardiola pays tribute to battling Mainz|
|Orlando City sign Shea|
|Porto 4 Vitoria Setubal 0: Brahimi inspires late drama|
|League Two Review: Burton held, Cambridge snatch late point|
|Millwall 0 Bolton Wanderers 1: Pratley nets winner for visitors|
|Lens 2 Nice 0: Cyprien and Coulibaly lift hosts|
|Celta Vigo 0 Almeria 1: Nolito miss proves costly|
|Heerenveen 0 ADO Den Haag 0: Visitors´ winless streak extended|
|Mainz 1 Bayern Munich 2: Guardiola´s men break Christmas points record|
|Blanc unconcerned by league placing|
|United targeting title - Carrick|
|Soldado ´ashamed´ at not performing for Spurs|
|Ramos to wait and see on fitness for final|
|Garcia wins appeal against two-match ban|
|Hart signs new City contract|
|Hereford United wound up|
|Pearson given touchline ban for fan row|
|FIFA confirms third-party ownership ban|
|Inter v Lazio: Ranocchia wants to build momentum|
|Rodgers hits out at Sterling criticism|
|Pardew backs Colback to shine against Sunderland|
|Minimal recovery time a concern for Bauza|
|Liverpool v Arsenal: Wenger out to avoid repeat performance|
|Newcastle United v Sunderland: Pardew calls for a derby day show|
|Adebayor available for Burnley clash|
|Athletic Bilbao v Atletico Madrid: Simeone´s men eye fitting response|
|Targett commits to Southampton|
|Garcia vows to attack Milan|
|City still without strike trio for Palace test|
|Courtois set for return at Stoke|
|Di Maria set for possible United return at Villa|
|Neymar in frame for Cordoba match|
|FIFA to publish Garcia report|
|Liverpool will not appeal Balotelli ban|
|A-League: Newcastle Jets 2 Adelaide United 1|
|Fournier eyes Fekir stay and attacking reinforcements|
|Abidal announces retirement ahead of potential Barca return|
|Redknapp: Crouch deal not possible|
|Klaassen laments Ajax ´off-day´|
|Wenger not fearful of another Anfield nightmare|
|Whelan wants to extend Stoke stay|
|Kalou eyes Hertha exit|
|Fellaini: Belief growing of title tilt at United|
|Benteke: Villa transfer request was a mistake|
|Gerrard urges Sterling to stay put|
|Pardew calls for calm ahead of derby clash|
|Kerala Blasters v Atletico de Kolkata: Luis Garcia talks up team ahead of final|
|Monk wants three new Swansea signings|
|Koeman plays down Sneijder link|
|Howard targets another World Cup|
|Inzaghi prepared for Stadio Olimpico atmosphere|
|Toronto expect Defoe to return|
|Rodriguez suffers injury setback|
|Klopp denies Dortmund departure plans|
|Copa del Rey Review: Bilbao and Elche edge through, Madrid derby beckons|