After going without a goal in his first five Champions League matches, Neymar scored three times here Wednesday in FC Barcelona's 6-1 demolition of lowly Celtic.
The Brazilian's first hat trick since joining Barça last summer came in a match where the club - playing without injured superstar Lionel Messi - needed a win or draw to be sure of finishing first in Group H and securing home field advantage for the round of 16.
Barcelona was already leading 2-0 when Neymar scored his first goal just before halftime.
The 21-year-old striker converted again in the 48th minute and completed the natural hat trick with a third tally 10 minutes later.
AC Milan and Ajax battled to a scoreless tie Wednesday, but the single point was enough to give the Italian club the second playoff berth from Group H.
Chelsea claimed the top spot in Group E with a 1-0 victory over Steaua Bucarest, while Schalke 04 beat Basel 2-0 to finish second.
In Group F, Napoli shut out Arsenal 2-0 and Borussia Dortmund, last year's runner-up, edged Olympique Marseille 2-1.
The Italian, English and German sides ended the group stage tied at 12 points apiece, leaving the final standings to be settled on the basis of goal differential.
Borussia, who outscored their opponents 11-6 over the six matches, snagged first place, followed by Arsenal. Napoli was forced to settle for a spot in the Europa League.
Atletico Madrid dominated Porto 2-0 on Wednesday to finish the stage with 16 out of 18 possible points and win Group G in a runaway.
Despite a 4-1 drubbing Wednesday at the hands of bottom-dwelling Austria Wien, Zenit St. Petersburg took second place in the group and will advance to the knockout phase.
Wednesday's action also included the completion of the previous day's snowstorm-interrupted Group B match between Galatasaray and Juventus.
Wesley Sneijder's goal in the 85th minute gave the Turkish club a 1-0 victory for second place behind group winner Real Madrid and a ticket to the round of 16.
Also moving on to the next phase are, from Group A: Manchester United, Bayer Leverkusen; Group C: Paris Saint-Germain, Olympiacos; Group D: Bayern Munich, Manchester City. EFE