Christian Noboa's superb free-kick earned Rostov a shock 3-2 Champions League win over Bayern Munich in Russia on Wednesday, leaving Carlo Ancelotti's side facing a tough last-16 draw.
The Bavarian giants thumped Rostov 5-0 in the opening fixture in September but lost their position at the top of the Bundesliga to RB Leipzig at the weekend following a 1-0 defeat at rivalsBorussia Dortmund and this was a second humiliation in a matter of days.
While Bayern were already assured of qualifying for the knockout stages the result means Atletico Madrid can clinch top spot in Group D if they avoid defeat to PSV Eindhoven in Spain later.
Douglas Costa rifled Bayern ahead on 35 minutes at the Olimp-2 stadium, but Rostov equalised through Sardar Azmoun on the stroke of half-time before going ahead courtesy of a Dmitri Poloz penalty.
Juan Bernat swiftly levelled for the Germans, but Ecuador international Noboa fired competition debutants Rostov to a first group stage victory with the winner on 67 minutes.
"It's a game we should win, Bayern should win here, regardless of the cold weather and the conditions," skipper Philipp Lahmtold Sky.
"We have been negligent, we have been punished for our errors and the changes made to the team are no excuse.
"To speak of a crisis is too much, but we must quickly correct our mistakes."
Bayern made the 2,100-kilometre trip east without goalkeeperManuel Neuer, Arturo Vidal and Arjen Robben through injury, while centre-back Holger Badstuber started for the first time since February.
Aleksandr Erokhin nearly headed the Russian outfit ahead after hesitant defending allowed him to nip in between Badstuber and goalkeeper Sven Ulreich only for Bernat to race back and clear off the line.
Renato Sanches, making his first Champions League start this term, tested Soslan Dzhanaev with a swerving effort from the edge of the area before Costa fired just over from a similar position.
The pair were both involved as Bayern broke the deadlock with Sanches bursting into the area down the left and Costa drilling home after Cesar Navas's weak clearance rolled invitingly into the Brazilian's path.
But Iranian international Azmoun levelled for Rostov just before the break after turning Jerome Boateng to coolly slot past Ulreich.
And the hosts grabbed a surprise lead after Boateng upended Noboa inside the box, with Poloz confidently tucking away the penalty for his third goal in five European matches.
Bayern hit back immediately as Franck Ribery slipped in Bernat, who lashed home from close range, but Rostov claimed a memorable win as Noboa's strike left Ulreich clutching at thin air.