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'
|Weidenfeller ruled out of Dortmund-Bayern semi-final|
|Weidenfeller ruled out of Dortmund-Bayern semi-final|
|Ligue 1 Review: Lens´ fate all but sealed, Lyon return top|
|La Liga Review: Hernandez rescues Real, Sevilla up to fourth|
|Paris Saint-Germain v Metz: Injuries prove a frustration for Blanc|
|Serie A Review: Juve made to wait as Parma fight another day|
|Celta Vigo 2 Real Madrid 4: Hernandez to the rescue again|
|Barcelona v Getafe: Iniesta keen to maintain momentum|
|Milan players in ´retreat´|
|United have opened the door for Liverpool - Van Gaal|
|Mourinho hits back at Arsenal fans´ ´boring´ jibes|
|Juve were own worst enemy in derby defeat – Allegri|
|Bundesliga Review: Gladbach victory ends title race|
|Udinese v Inter: Mancini braced for crucial week|
|Primeira Liga Review: O Classico tie leaves Benfica on the brink|
|Bayern Munich v Borussia Dortmund: Klopp prepares for final Klassiker|
|Russian Premier League Review: Zenit edge closer to glory, Amkar Perm off the bottom|
|Arsenal played with handbrake on - Wenger|
|Mourinho swerves Oscar discussion to hail Terry display|
|Bayern´s title confirmed as Wolfsburg stumble at Gladbach|
|Eredivise Review: Late leveller see Ajax secure Champions League berth|
|Arsenal 0 Chelsea 0: Oscar decision in the spotlight after stalemate|
|Van Gaal bemoans lack of fighting spirit|
|Van Gaal: United to assess Rooney injury|
|Torino 2 Juventus 1: First derby defeat since 1995 puts title celebrations on hold|
|Martinez hails Everton´s ´incredible mentality´ after beating United|
|Everton 3 Manchester United 0: Martinez outwits Van Gaal in comprehensive win|
|Dundee United 0 Celtic 3: Griffiths´ hat-trick edges champions closer to title|
|Alderweireld reveals he has broken shoulder bone|
|Hull City v Liverpool: Lovren expecting another test of patience|
|Leverkusen dealt Papadopoulos blow|
|Five in a row for Champions League winners Auckland|
|Vermaelen cleared to play in Barca run-in|
|Hughes buoyed by Odemwingie return|
|Allardyce hails Adrian heroics|
|Villa confident of staying up - Sherwood|
|Zorc rejects talk of Gundogan departure|
|´Happy´ Hazard rejects talk of Chelsea exit|
|A-League Review: Victory claim Premiers´ Plate|
|Pochettino hoping to strengthen|
|Pjanic critical of Roma spirit|
|Rodgers: No room for error now|
|MLS Review: Revolution win big as Dynamo, Kansas City draw|
|Garcia rues sloppy build-up play|
|Jokanovic eyes title for Watford|
|Blanc: PSG have moved on|
|Hazard worth ´£100m each leg´ - Mourinho|
|Ferguson: United boss can break my trophy record|
|Levante leap clear of La Liga drop zone|
|Primeira Liga Review: Gil Vicente claim vital win, Estoril and Rio Ave held|
|Icardi destined for the top - Mancini|
|Eredivisie Review: Depay inspires 10-man PSV, wins for Heracles and Utrecht|
|Simeone applauds Atletico´s response to European exit|
|Ligue 1 Review: PSG hit Lille for six, Bastia late show stuns Evian|
|Inter 2 Roma 1: Late Icardi strike puts Juve on brink of title|
|Bundesliga Review: Bayern all but champions, Hamburg claim long-awaited win|
|Guardiola focusing elsewhere with Bundesliga almost secure|
|Pellegrini salutes City spirit in Villa win|
|Inzaghi apologies to Milan fans after Udinese defeat|
|Matuidi hails PSG´s best|
|Sherwood lambasts Benteke decision as Villa miss out in late drama|
|League Two Review: Tranmere and Cheltenham lose League status, Shrewsbury promoted|
|Dyche bemoans ´cruel´ defeat|
|Manchester City 3 Aston Villa 2: Fernandinho concludes Etihad drama in City´s favour|
|League One Review: Colchester take survival battle to last day with victory|
|Pardew questions refereeing decisions|
|Bayern Munich 1 Hertha Berlin 0: Schweinsteiger strike all but seals title|
|Ramsey slams referee Jones after disallowed goal|
|Luis Enrique not looking towards title yet|
|Pearson: The win is all that matters|
|Bruce hails improved Hull display|
|Pulis hails ´great point´ for resilient West Brom|
|Udinese 2 Milan 1: Disappointing visitors´ European hopes dented|
|Atletico Madrid 3 Elche 0: Griezmann nets brace as Champions respond to European exit|
|Allardyce laments lack of squad depth|
|Advocaat still confident of survival|
|No loss of belief at Liverpool, insists Rodgers|
|Carver rues ´mad five minutes´|
|Hughes rues Stoke´s missed opportunities|
|Scottish Premiership Review: Aberdeen secure second as St Mirren fight on|
|Championship Review: Watford promoted as Fulham beat Boro|
|Monk revels in new points record|
|Klopp positive ahead of Bayern battle|
|Paris Saint-Germain 6 Lille 1: Lavezzi nets hat-trick as Blanc´s men go top|
|Newcastle United 2 Swansea City 3: Carver´s men continue worrying slide|
|Crystal Palace 0 Hull City 2: N´Doye at the double to give Bruce´s men vital win|
|Watford seal promotion to the Premier League|
|Stoke City 1 Sunderland 1: Adam strike piles pressure on Advocaat|
|Burnley 0 Leicester City 1: Vardy punishes Taylor´s penalty miss|
|West Brom 0 Liverpool 0: Landmark Gerrard appearance ends goalless|
|QPR 0 West Ham 0: Strugglers rue saved Austin penalty|
|Espanyol 0 Barcelona 2: Messi, Suarez and Neymar star for 10-man visitors|
|Koeman rues missed chances|
|Borussia Dortmund 2 Eintracht Frankfurt 0: Aubameyang inspires Klopp´s men|
|Pochettino thanks Spurs supporters|
|Fellaini contemplated leaving Man United|
|Southampton 2 Tottenham 2: Point for Pochettino on St Mary´s return|
|Ankle surgery ends Routledge´s season|
|Lopetegui hoping for Porto reaction|
|A-League Review: Glory end on a high, Adelaide hammer City|
|Howedes ´concerned´ by Schalke form|
|Ancelotti hopeful on injured trio´s fitness|
|Bernabeu return a possibility for Pogba|
|Marseille in crisis, claims Bielsa|
|Van Gaal tips Giggs as his successor|
|De Gea the boss in contract talks - Van Gaal|
|Mourinho hits out at Wenger|
|Shaqiri not going anywhere - Mancini|
|MLS Review: Goalkeeping blunder sees Chicago burn NYC|
|Ancelotti confident in Real´s chances|
|No Messi, no Barca claims ex-Bayern ´keeper Pfaff|
|Hamilton Academical 2 Motherwell 0: Canning gets first win as player-manager|