Borussia Dortmund face a difficult draw for the Europa League round of 32 and could face the likes of Manchester United - or Jurgen Klopp's Liverpool - after losing 1-0 at home to PAOK and finishing as runners-up in Group C.
The Greek side scored the only goal against the run of play in the 34th minute when Robert Mak was played through and rounded keeper Roman Weidenfeller.
Substitute Pierre-Emerick Aubameyang hit the post in the second half, but not even a draw would have been enough for Dortmund to win the group after Krasnodar won 3-0 at bottom side Qabala.
First-half goals by Ragnar Sigurdsson and Mauricio Pereira and a late third from Wanderson put the Russian side on 13 points, three clear of second-placed Dortmund.
The group winners will be seeded for the draw as the knockout stage begins, as will the top four third-placed teams from the Champions League group stage: Porto, Olympiakos, Manchester United and Bayer Leverkusen.
The Europa League group runners-up can will be unseeded along with Sevilla, Valencia, Galatasaray and Shakhtar Donetsk.
Liverpool managed a 0-0 draw at Sion to ensure they finished top of Group B.
Having already qualified for the knockout stages there was little for Liverpool to aim for and far more to avoid -- injury being the main concern on a pitch which appeared part frozen -- but everyone emerged unscathed to add a fourth draw to their two wins in six matches unbeaten in Europe.
Their Swiss opponents also advanced as Bordeaux drew 2-2 with Rubin Kazan, who had a chance to move on entering the day.
Second-half goals from Bordeaux's Gaetan Laborde and Diego Rolan cancelled out Maxim Kanunnikov's opener, and though Vitali Ustinov was fortunate to equalise while slipping late on, Rubin Kazan finished third in the group.
Erik Lamela scored a hat trick in the first half as Tottenham defeated Monaco 4-1 to secure the top spot in Group J.
Spurs took the lead just three minutes into the match as Ben Davies pushed forward on the left wing and centred for Lamela to tap in.
The Argentine doubled his tally on 15 minutes when his low shot from 20 yards beat keeper Danijel Subasic, and Lamela completed his hat trick in the 38th minute with a tidy finish at the near post.
Stephan El Shaarawy got one back for Monaco in the second half, before Thomas Carroll danced around Monaco defenders to restore Spurs' three-goal lead.
The defeat knocked the principality side out of the competition as Anderlecht advanced in second place with a 2-1 win over Qarabag.
Andy Najar and Stefano Okaka scored in a four-minute span to overturn Dani Quintana's opener for Qarabag.
Khouma Babacar scored in the second half to give Fiorentina a crucial 1-0 win over Belenenses that extended their Europa League campaign.
Joan Verdu supplied Babacar with the the ball in the centre of the box but the Senegalese still had work to do before finishing in the 67th minute.
Basel had already guaranteed themselves the top spot in Group I and finished the stage with a 1-0 win at Lech Poznan, Jean-Paul Boetius scoring five minutes into the second half.
Villarreal could also face a tall task in the round of 32 as a 3-3 draw at Viktoria Plzen meant they finished second in Group E.
After an early penalty put the hosts ahead, Cedric Bakambu equalised five minutes before the break, and Mexican international Jonathan dos Santos put Villarreal ahead on 62 minutes.
But Jan Kovarik equalised three minutes later and Tomas Horava looked to have won it for Viktoria in the 90th minute, only for Bruno Soriano to equalise for Villarreal deep into stoppage time.
The result allowed Rapid Vienna to win the group after they held on to a 2-1 win over Dinamo Minsk, Maximilian Hofmann and Matej Jelic on the scoresheet for the Austrian club.
Marseille's 4-2 win at Liberec was not enough to win Group F as Braga held on to the top spot with a 0-0 draw at Groningen.
Michy Batshuayi, Georges N'Koudou and Abdelaziz Barrada had put the French side 3-0 up, and OM held on after Liberec attempted a late rally with goals from Marek Bakos and Josef Sural, and Lucas Ocampos wrapped up the points before the final whistle.
Ajax are out of the competition after a 1-1 draw at home against Group A winners Molde.
Donny van de Beek scored the opener for Ajax with a looping header and paid for his goal with a clash of heads that left him bloodied.
But the Norwegian club, who got another strong performance from American goalkeeper Ethan Horvath, equalised before the half-hour through Harmeet Singh.
Fenerbache ended Celtic's miserable Europa League campaign to go through as runners-up with a 1-1 draw at home.
Lazar Markovic scored the only goal on 39 minutes, and winless Celtic found an equaliser through Kris Commons after Diego was sent off in the second half.
Napoli completed a perfect group stage by defeating Legia Warsaw 5-2.
Chelsea loanee Nathaniel Chalobah opened the scoring with a long shot, and Napoli followed up with goals from Lorenzo Insigne, Jose Callejon and a Dries Mertens brace.
FC Midtjylland also advanced from Group D after a 1-1 draw against Club Brugge, Pione Sisto's remarkable effort from distance at a tight angle enough to put the Danish side through despite Jelle Vossen's equaliser.
In Group K, Schalke won 4-0 at Asteras Tripoli, as Franco Di Santo and a Eric Maxim Choupo-Moting brace helped the German side to finish top.
Sparta Prague had also advanced already but will move on as runners-up after a 3-1 win at APOEL, Lukas Julis's goal cancelling out the hosts' early opener before a David Lafata brace secured all three points.
Raul Bobadilla scored a dramatic late goal to put Augsburg into the next stage by the slimmest of margins with a 3-1 win against 10-man Partizan Belgrade.
The Paraguayan's header made the head-to-head tiebreaker even, and the German club advanced with a superior goal difference.
Aboubakar Oumarou had put Partizan ahead, and Jeong-Ho Hong and Paul Verhaegh scored to begin the comeback before Bobadilla's 89th-minute goal.
Athletic Bilbao were held to a 2-2 draw by AZ Alkmaar but finished top of Group L.
After Joris van Overeem gave the Dutch club and early lead, Kike Sola and Mikel San Jose scored either side of half-time to put Athletic ahead before Vincent Janssen's equaliser two minutes from time.
Sporting Lisbon won 3-1 at home against Besiktas to advance at the expense of their opponents in Group H.
The visitors found the breakthrough through Mario Gomez and appeared to be going through until Sporting exploded for three goals in a 10-minute span, Islam Slimani, Bryan Ruiz, and Teo Gutierrez finding the net.
But it was Lokomotiv Moscow who won the group thanks to a 3-0 victory at Skenerbeu, Dmitri Tarasov scoring before Baye Oumar Niasse and Aleksandr Samedov added two late goals.
Lazio and Saint-Etienne wrapped up the group stage with a 1-1 draw as both sides advanced to the knockout stage.
Alessandro Matri scored first for Group G winners Lazio, before Valentin Eysseric equalised for runners-up ASSE.
Matheus scored twice as Dnipro defeated Rosenborg 3-0 in the group's other game.