Substitute Perisic made sure of the points late on meaning Bayern are guaranteed to progress from Group B, leaving Flick to now prepare Bayern for a crucial Bundesliga clash with Borussia Dortmund.

Thomas Muller saw a couple of half shouts for penalties turned down either side of Sa reacting sharply to a low Leon Goretzka drive as Bayern started brightly.

David Alaba's untimely stumble allowed Olympiacos a rare sight at goal but Lazar Randjelovic dragged wide of the right post.

Lewandowski headed Pavard's pin-point cross straight at Sa, who was also alert to deny Kingsley Coman's improvised toe poke after a mazy run.

Pavard's awkward effort off his chest struck the post at the end of the half and Sa made a fine save from Goretzka's point-blank header shortly after the restart.

Sa was called into action again by Coman's stinging effort, but he was finally beaten in the 69th minute when the France winger's teasing low delivery from the right was cutely steered home by Lewandowski at the front post.

A more deserved-looking scoreline arrived in the final minute when Perisic rifled high into the roof of the goal after Coman's deflected cross fell into his path.

Bayern show much-needed resolve

After the Frankfurt humiliation, Bayern needed a reply and – while it was not the most fluent performance – they were good value for a fourth win in as many Group B games. It was a decent show of resilience, but the club will be keen to have a new permanent boss at the helm soon.

You were Sa unlucky to be on the losing side, Jose

Olympiacos offered little going forward and were content to try and contain Bayern's heavyweight attack. But had it not been for Sa the scoreline would have been much more comfortable, with the away goalkeeper unlucky to finally be beaten by Lewandowski, who has scored 31 group-stage goals since joining Bayern in 2014 – no player has more in the same time (Lionel Messi also has 31).