France midfielder Corentin Tolisso scored twice to earn Bayern Munich victory but Paris St-Germain advance to the Champions League last-16 draw as Group B winners.
Bayern needed to win by four goals to finish above PSG and they got off to a fine start with Robert Lewandowski's close-range finish after eight minutes.
Tolisso's header doubled the lead before Kylian Mbappe made it 2-1.
Tolisso added a third for Bayern, who go through as runners-up.
Both teams finished on 15 points, but PSG's head-to-head record ensured they finished top.
The German champions will be unseeded when the draw for the knockout stage takes place next Monday at Uefa headquarters in Nyon, Switzerland.
Bayern boss Jupp Heynckes declared himself satisfied with his side's performance.
"The game shows we are getting better, that we believe in ourselves," he said.
Elsewhere in Group B, Celtic finished third and qualify for the Europa League despite losing 1-0 at home to Anderlecht.
PSG would have become the seventh team to win all six group games - and the first since Real Madrid in 2014-15 - had they won.
However, they were frustrated by keeper Sven Ulreich, who made a hat-trick of saves to deny Neymar and Mbappe.
Source: BBC Sports