MUNICH — Bayern Munich won 3-1 to deal Paris Saint-Germain its biggest defeat of the season but still had to settle for second place behind the French team in their Champions League group on Tuesday.

Bayern lost the previous meeting 3-0 in Paris – a defeat that cost Carlo Ancelotti his job as coach – and needed to beat PSG by four goals to finish top of Group B. Both sides were already assured of progress to the last 16.

“Altogether, we showed a good game. We put into effect what it was we wanted to do,” Ancelotti’s successor, Jupp Heynckes, said.

Robert Lewandowski got Bayern off to a flying start after Kingsley Coman headed James Rodriguez’s cross on toward goal. The Poland striker needed no second invitation for his third goal of the campaign.

The home side assumed control, though PSG’s Kylian Mbappe and Neymar showed glimpses of danger. The Brazilian should have done better when Mbappe sent him through with a brilliant pass.

James crossed for Corentin Tolisso to double Bayern’s lead before the break.

Bayern needed just two more in the second half to top the group, but Mbappe dented those hopes soon after the break when Edinson Cavani lifted the ball for the teen to head past Sven Ulreich in the Bayern goal.

Coman burst through to set up Tolisso’s second goal midway through the half. It was enough to restore the home side’s pride, albeit not enough to top the group.

“It was good for us, for our confidence and for our fans,” Bayern captain Franck Ribery said.

Both sides finished with 15 points, well ahead of Celtic and Anderlecht, both on three. Anderlecht won in Glasgow 1-0 but Celtic finished third to take the Europa League place.


More AP Champions League coverage: https://apnews.com/tag/ChampionsLeague