Atletico Madrid's hopes of qualifying from their UEFA Champions League group will go down to the final matchday after Thomas Muller scored an 86th-minute penalty to earn a weakened Bayern Munich a 1-1 draw at the Wanda Metropolitano.
Bayern had won their previous 15 games in UEFA's flagship competition but were already assured of top spot in Group A and left the likes of Robert Lewandowski and Manuel Neuer out of their travelling squad.
With Lokomotiv Moscow losing 3-1 at home to Salzburg earlier on Wednesday (AEDT), victory for Atleti would make certain of second place with a game to spare, an aim they were on course to achieve thanks to Joao Felix's eighth goal in 14 appearances this season.
The Portugal international converted from a Marcos Llorente cutback after 26 minutes, but Felipe - brought on for the injured Jose Gimenez - felled Muller in the box and his fellow substitute converted from 12 yards.
Atleti must now avoid defeat away at Salzburg next week to join Bayern, unbeaten in 14 games in all competitions after Muller's late goal, in the last 16.
Angel Correa tested Alexander Nubel, making his first appearance in the competition for Bayern, and Yannick Carrasco fired wide in a bright start to the match for Atletico.
The hosts made the breakthrough soon after as Llorente played a one-two on the right, carried the ball to the byline and picked out Joao Felix to finish from six yards.
Jamal Musiala fired just wide following a mazy run but Atleti still looked the more threatening, with Joao Felix denied by Nubel and Llorente blazing over from a good position.
Jan Oblak was called into action for the first time to routinely save from Eric Maxim Choupo-Moting's long-range effort just short of the hour mark as Atleti, boasting five clean sheets in six prior home games, held firm at the back.
But Bayern's pressure eventually told after Hansi Flick introduced Kingsley Coman and Muller, the latter being brought down in the box by Felipe's outstretched leg for a late penalty that he guided past the despairing dive of Oblak.