Alvaro Morata grabbed a late winner with Cristiano Ronaldo also scoring as Juventus qualified for the Champions League last 16 with a 2-1 win over Ferencvaros on Tuesday.
Myrto Uzuni had given the Hungarians a shock 19th-minute lead in the Group G clash in Turin.
But Ronaldo rifled in the equaliser on 35 minutes for his first Champions League goal this season, extending his record to 131 goals in the competition.
And Spaniard Morata came off the bench to seal victory two minutes into injury time with his fifth group-stage goal this term.
Andrea Pirlo has achieved his first objective as Juventus coach having taken over from Maurizio Sarri after the Italians crashed out of the Champions League in the last 16 to Lyon last season.