Munich - A Robert Lewandowski free-kick sealed Bayern Munich's 1-0 win over Atletico Madrid on Tuesday in the Champions League with both teams already through to the knock-out stage.
Despite the result at Munich's bitterly cold Allianz Arena, Atletico go into the draw for the last 16 as Group D winners with Bayern second.
"The result had little worth in terms of the table, but it meant a lot for our self-confidence," said Bayern coach Carlo Ancelotti.
"We have to keep improving, and we'll do that step by step."
Having been knocked out in the semi-finals by Atletico last season, Bayern avenged their 1-0 defeat in Madrid in September and extended their record streak in Champions League to 15 wins at home.
But Lewandowski's superb first-half strike was the difference.
Atletico, who were close to full strength, suffered their first defeat in the group stages this season having been the only team to win all of their previous five.
It denied them a club record of a perfect six.
"We had a couple of big chances at the start, but then Bayern took control," said Atletico coach Diego Simeone.
"They controlled the ball and dominated the first half.
"In the second period, we looked better and it was more even and we come away with a positive feeling from our final 15 minutes.
"The first half was a different story to the second and we improved a lot."
Ancelotti switched from the 4-2-3-1 formation, which won 3-1 at Mainz in the Bundesliga, with a 4-3-3 formation, surprisingly leaving Thomas Mueller on the bench.
Lewandowski played either side of Arjen Robben and Douglas Costa on the wings with Thiago Alcantara, Arturo Vidal and teenage Portugal international Renato Sanches in midfield.
Simeone's Atletico made a bright start with Yannick Carrasco, who scored when the hosts won 1-0 in Madrid in September, twice forcing Bayern goalkeeper Manuel Neuer into action.
Bayern took the lead when Poland's Lewandowski majestically floated his free-kick over the wall from the edge of the box and into the top corner on 28 minutes.
It was from almost exactly the same position Lewandowski scored from in Friday's 3-1 win at Mainz, but Madrid goalkeeper Jan Oblak was powerless to stop it.
It was Lewandowski's 24th goal in 24 appearances for club and country this season.
In celebration, the 28-year-old shoved the match ball under his playing shirt and stuck his thumb in his mouth and later revealed his wife Anna was pregnant.
"It was a good moment to reveal that my wife is pregnant. I practised free kicks before, but I have been practising them since the beginning of this season," said Lewandowski.
Atletico's defence frustrated the Bayern attack after the break with Sanches twice unable to get a clean shot away from good positions due to Madrid shirts blocking him.
The hosts starved Atletico of the ball with Bayern enjoying just under 75 percent possession.
Thiago squandered a golden chance to add a second on 78 minutes.
Costa whipped in a pin-point cross, but the Spain international's half volley from five metres out flew over the bar with the goal at his mercy.