Marseille progressed to the last 32 of the Europa League after repelling a late flourish from Slovan Liberec to triumph 4-2 in the Czech Republic.
The French side looked home and dry when they led 3-0 early in the second-half following goals by Michy Batshuayi, Georges-Kevin N'Koudou and Abdelaziz Barrada.
But Liberec, who had to win in pursuit of qualification from Group F, fought back with two goals in a minute as Marek Bakos netted a 74th-minute penalty, before Josef Sural added a second barely 60 seconds later.
Marseille regained their composure, though, and Lucas Ocampos' goal deep into added time ensured a safe passage as group runners-up behind Braga.
Marseille, needing only a point to secure their place in the first knockout phase, struck after just 14 minutes when Belgian forward Batshuayi finished impressively and increased Liberec's degree of difficulty.
Batshuayi latched on to a through-ball from Barrada and then sent a left-footed shot past Liberec goalkeeper Tomas Koubek.
Austrian referee Robert Schorgenhofer soon left his mark on the game, though, dishing out three yellow cards in as many minutes to Marseille trio Batshuayi, goalkeeper Steve Mandanda and Remy Cabella, while Liberec pair Bakos and skipper David Pavelka also found themselves cautioned.
But Marseille were not knocked out of their stride and they doubled their lead two minutes before half-time when the impressive Barrada again played the role of provider, freeing N'Koudou in space and he effortlessly rounded Koubek to leave Liberec in deep trouble.
And matters deteriorated for the home side just three minutes into the second period as Marseille appeared to put the game beyond doubt when Barrada scored, but Liberec had no intention of going quietly.
Bakos and Sural struck in quick succession as an unlikely fightback gathered momentum, but an equaliser eluded the home side and Ocampos belatedly put the game beyond doubt.