Zenit St Petersburg lurched into the knockout stages of the Champions League as Atletico Madrid's defeat of Porto rendered the Russian side's 4-1 loss at Austria Vienna meaningless.
All seemed rosy for Zenit when Alexander Kerzhakov slotted home in the 35th minute.
However, two goals by Philipp Hosiner and a Tomas Jun strike in the space of eight minutes either side of half-time put the match beyond the visitors with Roman Kienast scoring the fourth in stoppage time.
For Austria Vienna, though, it saw them win their first Champions League match but it means Zenit progress with just one victory in Group G.
They were almost behind in the sixth minute, scythed apart when Hosiner and Jun played a one-two but the former shot straight at the goalkeeper Yuri Lodigin.
After a spell where Zenit had plenty of possession but created little they sparked to life up front. Hulk jinked inside the area and moved the ball on to his left foot before unleashing a swerving drive that goalkeeper Heinz Lindner pushed out.
Domenico Criscito then fired in a shot from distance which Lindner dived to his left to put out for a corner. Cristian Ansaldi beat the offside trap and collected a crossfield ball to move in on goal but Lindner came out quickly to block.
Kaja Rogulj just failed to get enough leverage on a header for the hosts as boos began to ring out around the stadium with the home fans seemingly disgruntled with the flares set alight by Zenit supporters.
Kerzhakov then slotted home for Zenit but he had clearly drifted offside and the match was temporarily halted following the unrest from the crowd.
However, Kerzhakov put Zenit ahead nine minutes before the break when he collected the ball, turned Manuel Ortlechner who subsequently slipped and took the ball to the right of Lindner before slotting home.
Zenit though failed to hold on until half time and they were the architects of their own downfall.
Tomas Hubocan failed to control a free-kick in his own half and Hosiner pounced, playing a one-two with Marko Stankovic and, although his touch took him wide, the striker managed to hit the ball across the keeper and squeeze inside the far post. It was the first goal Austria Vienna had scored on home soil in the Champions League.
The hosts then took the lead in the 48th minute and again Zenit contributed with a poor clearance by the goalkeeper. Markus Suttner then slotted a ball to the near post which Jun ran on to and fired home. Just two minutes later and Vienna got a third, capitalising on sloppy Zenit defence.
Florian Mader's shot was parried into the path of Hosiner who made no mistake. Kerzhakov blazed over but they impressed little as they staggered into the knockout round.