Juventus progressed to the Champions League last 16 after a Cristiano Ronaldo goal and a stoppage-time header from substitute Alvaro Morata gave them a comeback 2-1 home win over Hungarians Ferencvaros on Tuesday.
The result left Juve second in Group G on nine points from four games, three behind leaders Barcelona who also booked a knockout-stage berth with a 4-0 win at Dynamo Kyiv.
Ferencvaros and Dynamo are level on one point and will vie for the consolation prize of joining the Europa League round of 32 after the winter break.
The Hungarian side took a shock 19th-minute lead through Myrto Uzuni before Ronaldo equalised in the 35th with a sweet, left-foot shot from 20 metres moments after he had a goal scrapped for offside.
Juventus coach Andrea Pirlo said a tactical switch to attacking down the flanks instead of through the middle paid off in the second half.
"I think we were better in the second half, tactically," said the former Italy midfielder.
"Sometimes we tried too often to break through the middle while we should have played more on the flanks. It was important to win and qualify, we tried until the end and this is what I liked the most."
Juventus twice hit the woodwork in the second half before Morata's late header squeezed under visiting goalkeeper Denes Dibusz's body and over the line after a fine cross from the right by Juan Cuadrado.