Captain Kostas Fortounis scored late from the penalty spot to help Olympiakos defeat AC Milan 3-1 on Thursday and knock the seven-time European champion out of the Europa League.

Sevilla, Villarreal, Genk, Celtic, Rapid Vienna, Malmo, Krasnodar, Rennes, BATE and Slavia Prague also qualified for the knockout rounds of Europe's second-tier competition on the final night of group-stage matches.

The five-time winner of the competition, Sevilla advanced from Group J after a 3-0 win over Krasnodar, which also advanced. Villarreal defeated Spartak Moscow 2-0 to progress from Group G with Rapid, which scored in the 84th minute to win 1-0 and knock out Rangers.

In Group B, Celtic avoided elimination despite a 2-1 defeat at home to Salzburg after Leipzig drew with Rosenborg 1-1.

Genk cruised to the next phase with a 4-0 rout of Sarpsborg in Group I, and Malmo also made it with a 1-0 away victory over Besiktas.

Rennes' new coach, Julien Stephan, celebrated a 2-0 victory in Group K and a spot in the next round by knocking out Astana, and Slavia Prague made it with a 2-0 win over Zenit in Group C.

Arsenal, Bayer Leverkusen, Chelsea, Dinamo Zagreb, Dynamo Kyiv, Eintracht Frankfurt, Fenerbahce, Lazio, Real Betis, Salzburg, Sporting, Zenit and Zurich already booked their places in the round of 32 earlier in the competition.

Eight teams knocked out of the Champions League — Benfica, Club Brugge, Galatasaray, Inter Milan, Napoli, Shakhtar Donetsk, Valencia and Viktoria Plzen — also qualified for the round of 32 by finishing in third in their groups.

The draw for the round of 32 will be held on Monday, an hour after the Champions League draw is held.

Although Chelsea failed to keep a perfect group-stage record, Willian and Olivier Giroud salvaged a 2-2 draw against Vidi in Budapest by scoring from free kicks.

But the game was marred by Chelsea supporters singing an anti-Semitic chant, with the club condemning their behaviour in a statement and saying it has no place at Chelsea. The incident came just days after four fans were suspended for abusing Manchester City forward Raheem Sterling.

In London, Arsenal celebrated captain Laurent Koscielny's return from a torn Achilles tendon with Alexandre Lacazette scoring in a 1-0 win against Qarabag.

Here's a look at Thursday's action:

___

LATE DRAMA

After Olympiakos' Pape Abou Cisse scored on the hour following a short corner, Milan's Cristian Zapata hastened his team's exit 10 minutes later with an own goal after deflecting a shot into the net.

Although he scored two minutes later to trim Milan's deficit to one goal, Fortounis scored on a penalty after sending Milan goalkeeper Pepe Reina the wrong way.

Betis won Group F with 12 points after a 0-0 draw against Dudelange, and though Olympiakos and Milan both finished with 10 points, Olympiakos advanced on the tiebreaker.

___

CHELSEA HELD

Willian was the only player who started the Premier League victory over Manchester City on Saturday to do so on Thursday, and he opened the scoring from a free kick after half an hour.

Ethan Ampadu headed in an own goal two minutes later in his European debut, marking only the second time Chelsea had conceded in the Europa League.

Vidi moved ahead in the 56th minute when Loic Nego finished a counter with a precise volley, but Giroud, a second-half substitute, curled in an equalizer in the 75th minute.

Chelsea topped Group L with 16 points. BATE became the second team to advance from the group with nine points after a 3-1 win at PAOK.

___

TIGHT GROUPS

All eight teams were in a position to advance from tightly contested groups G and I.

Samuel Chukwueze was in the right place for Villarreal when he scored from a deflected shot in the first half, and Karl Toko Ekambi doubled the lead from a tight angle in the second as Villarreal topped Group G with 10 points.

Rangers had the support from their fans in Vienna, but substitute Dejan Ljubicic scored six minutes from time as Rapid advanced, also with 10 points.

In Group I, Genk needed a draw against Sarpsborg but refused to play it safe. Forward Zinho Gano needed just three minutes to volley home an opener, and midfielder Joseph Paintsil collected a precise pass from captain Alejandro Pozuelo to calmly to make it 2-0 five minutes later. Sander Berge and Joseph Aidoo put it beyond doubt with a pair of goals scored within three minutes in the second half.

In Istanbul, Marcus Antonsson stunned Besiktas with a second-half goal to send Malmo through with nine points.

Besiktas' efforts to equalize, which would have been enough to advance, took a hit when Ricardo Quaresma received a red card in the 65th minute.

___

SEVILLA SAFE

Wissam Ben Yedder made sure to ease Sevilla's worries with two goals in the first 10 minutes, exploiting a defensive mistake five minutes in and controlling a long ball before scoring past goalkeeper Stanislav Kritsyuk five minutes later for his fifth group-stage goal.

Krasnodar was reduced to 10 men early in the second after Cristian Ramirez's handball on the goal line stopped Andre Silva's header. Ever Banega increased the lead by scoring on the ensuing penalty.

___

More AP soccer: https://apnews.com/apf-Soccer and https://twitter.com/AP_Sports