Joao Cancelo and Joao Felix earned Barcelona a 2-1 comeback win against Porto to book their spot in the Champions League knockout rounds for the first time in three seasons.
After crashing out of the competition in the group stage two years in a row, five-times champions Barca are back in the last 16 after securing a top-two finish with one game remaining.
Barcelona are top of Group H on 12 points, three ahead of Porto and Shakhtar Donetsk who will play each other on the final match day to decide who will join the Spaniards in the knockout stage.
Shakhtar beat Antwerp 1-0 on Tuesday courtesy of Mykola Matviyenko's early goal to give themselves real hope of going through.
Barca need at least a draw against bottom side Antwerp in two weeks' time to guarantee top spot in the group.
They had to dig deep against a valiant Porto who were the better side in the first half but were frustrated by an inspired performance from Barca goalkeeper Inaki Pena, who replaced injured Marc-Andre ter Stegen and made several excellent saves to keep the hosts in the game.
Pena made a reflex save to deny a point-blank strike from Galeno in the 28th minute and blocked another effort by the Porto winger two minutes later, but this time Pepe was well placed inside the box to strike home the rebound and put them in front.
However, Barca hit back two minutes later, with a fine curling shot into the top corner by Cancelo after he dribbled past Joao Mario.
Porto didn't give up and almost got back in front in the 43rd minute, when Pena made a superb one-handed save to palm another Galeno shot from range around the post right before the break.
But Cancelo and Felix came out firing in the second half and Barcelona were transformed with the Portuguese duo causing all kinds of trouble for the visitors' defence.
Felix unleashed a thunderous strike from range in the 47th minute that crashed against the crossbar and he linked up well with Cancelo, both of whom started their career at the Benfica academy, Porto's rivals in Portugal.
Cancelo was excellent running down the left channel and teed up Felix for a tidy first-time finish just beyond the goalkeeper's reach in the 57th minute to secure the win.
Group F: Dortmund seal progression with statement victory in Milan
Borussia Dortmund booked their spot in the last 16 by beating AC Milan 3-1 at the San Siro in a lively Group F clash.
Marco Reus, Jamie Bynoe-Gittens and Karim Adeyemi were all on target to help Dortmund top the group on 10 points, with Paris Saint-Germain, who drew 1-1 against Newcastle, second on seven.
Milan, bottom on five points from five games, can still secure a top-two finish if they win at Newcastle and Dortmund beat PSG in the final round of games next month.
"If we avoid looking at our attacks in the first half, we did well," said Dortmund defender and player of the match Mats Hummels.
"With our possession, we managed to keep the atmosphere in check. It is great to play Champions League in such a stadium. We want to deliver again at home in two weeks and secure first place in front of our fans."
Dortmund will be confirmed as group winners if they avoid a home defeat by PSG.
Group E: Own goals see Atletico into knock-outs
Two own goals plus a brilliant Mario Hermoso hooked volley gave Atletico Madrid a 3-1 win at Feyenoord and a place in the Champions League last 16 while eliminating the hosts.
Feyenoord's Lutsharel Geertruida put the ball into his own net after 14 minutes before Hermoso added a stunning second goal in the 57th, although Feyenoord pulled one back with 13 minutes left as Mats Wieffer headed home from a corner.
However, a second own goal four minutes later, this time from Santiago Gimenez, wrapped up the points for Atletico who moved top in Group E and claimed a knockout-stage berth.
They have 11 points, one more than Lazio, who also reached the last 16 on Tuesday by beating Celtic 2-0 in Rome, with their spot guaranteed by Feyenoord's defeat.
Group G: Man City top group, Young Boys into Europa League
Manchester City's Julian Alvarez scored in the 87th minute as the European champions clawed their way back from two goals down to beat RB Leipzig 3-2 and clinch top spot in Champions League Group G on Tuesday with one round of matches remaining.
Erling Haaland and Phil Foden also netted in the second period after one of City's most underwhelming recent first-half performances to give Pep Guardiola's team 15 points after five games. Leipzig, who had also reached the last 16, have nine.
"First half was the worst I've seen us," midfielder Foden told TNT. "Courage and motivation changed it around. This team has great mentality and its so nice to see."
Haaland added another record to his bulging resume, becoming the fastest player to 40 Champions League goals. The striker became the quickest to 50 Premier League goals on Saturday.
Three days after their 1-1 top-of-the-table Premier League draw with Liverpool, City looked like zombies through the first half, although they had a flurry of chances before the break, their best being Dias's header over the bar.
It was Guardiola's second comeback from a two-goal deficit in his Champions League managerial career after his Bayern Munich side rallied to beat Juventus in the 2016 quarter-finals.
City finish the group stage at Red Star Belgrade on December 13.
Young Boys, who are third on four points, secured a place in the Europa league knockout round playoffs with a 2-0 home win over Red Star. The Belgrade side are bottom with one point.