Alvaro Morata's late header lifted Juventus into the Champions League knockout stages as Andrea Pirlo's side claimed a last-gasp 2-1 win over Ferencvaros.
It looked as though Juve would fall five points behind Group G leaders Barcelona as they toiled in Turin, with Ferencvaros' goalkeeper Denes Dibusz having made a string of fine stops.
Dibusz had been beaten by Cristiano Ronaldo's thumping 35th-minute equaliser, which cancelled out Myrto Uzuni's opener and moved the 35-year-old level with Lionel Messi on 70 home Champions League goals.
Yet it was an error from Dibusz – who made several mistakes in the reverse outing – which ultimately cost Ferencvaros a point, the goalkeeper only able to fumble Morata's header over the line in the 92nd minute.
70 - #CristianoRonaldo has scored 70 goals in Champions League home games: a joint-record for home goals in the history of the competition, level with Lionel Messi. Monsters.#ChampionsLeague #UCL pic.twitter.com/uU0HzYm1LI— OptaPaolo (@OptaPaolo) November 24, 2020
Paulo Dybala volleyed at Dibusz with a quarter of an hour gone and Juve fell behind four minutes later – Uzuni tucking into a gaping goal after Tokmac Nguen had capitalised on Matthijs de Ligt's mistake.
Juve soon hit back and, two minutes after he saw a strike disallowed for offside, Ronaldo equalled Messi's haul of home goals in UEFA's premier competition, lashing a strike into the bottom-right corner from the edge of the area.
Ronaldo almost had his second early in the second half, but Dibusz beat him to a poor backpass.
Dibusz pulled off another vital stop on the hour, tipping Federico Bernardeschi's venomous strike onto the upright before he then denied Ronaldo a tap-in with a well-timed dive at the forward's feet.
The post came to Dibusz's rescue when Morata curled a close-range strike beyond him, but another fine stop from Rodrigo Bentancur's effort seemed to have sealed a point.
It was not to be, though, with Dibusz failing to keep out a Morata header which was directed straight at him as Juve clinched their last-16 place with two games to spare.
What does it mean? Juve through, but Bianconeri have work to do at both ends
Juve are second on nine points, eight clear of both Ferencvaros and Dynamo Kiev with two games remaining, though they must be much better if they are to progress deep into the competition.
As would be expected, Juve dominated possession (66.1 per cent) and mustered 19 attempts. While profligate finishing will be a concern for Pirlo, his side were also open at the other end, allowing Ferencvaros to have nine shots, and the hosts were fortunate only two were on target.
Morata equals his Champions League best
A move back to Juve seems to have reinvigorated Morata, though his chance looked to have gone after he hit the woodwork when one-on-one with Dibusz.
However, luck was on his side, and Morata's header now means he has netted five Champions League goals this term, equalling his best tally in the competition, which came when he helped Juve to the final in 2014-15.
From hero to zero
It was a tough break for Dibusz, who had been at his best through the game, making five saves, with the finger-tip stop to deny Bernardeschi a particular highlight.
But his concentration ultimately slipped at the vital moment, and the 30-year-old will be left to reflect on another Champions League howler.
Key Opta Facts
- Juventus have qualified for the knockout stages of the UEFA Champions League for the seventh consecutive season, last failing to do so in 2013-14.
- Juve have won eight of their last nine group-stage games in the Champions League, with their only defeat in their last 10 such games coming against Barcelona in October (0-2).
- Ferencvaros are winless in their four European Cup/Champions League games against Italian opponents (D1 L3).
- Juve's Cristiano Ronaldo has become the third player to score in 15 consecutive Champions League campaigns, after Karim Benzema and Lionel Messi (16).
- Alvaro Morata has scored five goals in four Champions League games this season, equalling his best tally in a single season of the competition – also scoring five in 12 games for Juve in 2014-15.
Benevento are Juve's next Serie A opponents, before the Bianconeri host Kiev in the Champions League. Ferencvaros go up against Barca next week.