The attacking trio of Lionel Messi, Neymar and Luis Suarez were all on target as Barcelona came from behind to beat Paris Saint-Germain 3-1 on Wednesday in their Champions League Group F decider.
Both sides had already qualified for the last 16, but first place was still up for grabs, with the French champions needing just a point at the Camp Nou and Barcelona having to win.
When Zlatan Ibrahimovic put the visitors ahead against his old club on 15 minutes, PSG appeared to be in control, but Barcelona's all-star front line all weighed in with goals to swing the match back the home side's way and ensure that they go through to next Monday's draw as group winners.
Messi equalised just four minutes after Ibrahimovic's opener, before Neymar put the hosts ahead on 42 minutes and Suarez secured the victory 13 minutes from time, ending PSG's record as the last club in Europe's leading leagues still to be unbeaten in all competitions this season.
"We posed them problems but we were not clinical enough," said PSG coach Laurent Blanc, who admitted that his team can now expect a tough draw in the last 16.
"It is a disadvantage to finish second. In a group with FC Barcelona, you can expect to be in a real battle to finish first. We couldn't do it, and now we impatiently await the draw."
Barcelona coach Luis Enrique said: "We have fulfilled our part of the contract by finishing first. And the team that draws us will undoubtedly not be happy.
"With both sides having already qualified ahead of this game, Blanc had admitted that his men would be able to play with more freedom, as long as they could get the ball from their hosts.
Ibrahimovic strikes first
Barcelona monopolised possession from the start, but PSG took the lead with their first shot on target, Ibrahimovic beating Marc-Andre ter Stegen with a first-time effort on his left-foot after Blaise Matuidi had laid off a Lucas ball in from the right.
It was the Swede's 12th goal of an injury-hit campaign and the first time he had ever scored against Barcelona, the club with whom he spent a year under Pep Guardiola in 2009-10.
However, Barcelona were quickly back level, Messi arriving at the back post to convert after neither David Luiz nor 'keeper Salvatore Sirigu had cut out Suarez's first-time ball across the six-yard box.
Messi now has 75 Champions League goals, and 76 in all European competitions, equal with the all-time record mark of former Real Madrid star Raul.
Nevertheless, Luis Enrique's decision to start with a back three left plenty of space for PSG to exploit in wide areas and they had chances to reclaim the lead.
A Matuidi ball in from the left was struck wide by Lucas, and then Edinson Cavani connected with an Ibrahimovic assist from the other side, forcing a save from ter Stegen.
However, the Catalans displayed their fearsome attacking firepower at the other end as Sirigu beat away a Suarez shot before Neymar put them in front three minutes prior to the break.
The Brazilian was released by Andres Iniesta before advancing and curling a superb shot beyond Sirigu into the right corner of the net for his third goal in the competition this season.
It remained an enjoyably open contest in the second half and the French champions almost equalised in the 53rd minute when Lucas broke into the area, only for ter Stegen to deny the Brazilian before Cavani's follow-up was blocked by Marc Bartra.
Blanc sent on Javier Pastore and Ezequiel Lavezzi for midfield duo Marco Verratti and Matuidi as his side went in search of the equaliser that would have put them back on top of the group.
Yet it was Barcelona who scored again in the 77th minute, with Suarez getting on the scoresheet at the Camp Nou for the first time since joining the club from Liverpool in the summer.
When Neymar's shot was turned out by Sirigu, Suarez was on hand to convert the rebound, securing the win and sealing revenge for a 3-2 defeat in Paris at the end of September.