Juventus football club went through to the Champions League quarter final on a 3-2 aggregate score, as Cristiano Ronaldo scored a hat trick for the club.

Trailing 2-0 from the first leg in Madrid, Juventus thought they had halved the deficit within four minutes when Giorgio Chiellini turned the ball in from a corner, but his effort was ruled out by VAR.

But Ronaldo – who had only scored one Champions League goal all season coming into the game – gave them hope when he headed in Federico Bernadeschi’s cross with 27 minutes gone, and pulled Juve level three minutes after the break from another wide delivery.

With extra-time looming, Bernadeschi was nudged over by Angel Correa inside the Atletico box and referee Bjorn Kuipers pointed straight to the spot, from which Ronaldo showed nerves of steel to send Jan Oblak the wrong way and fire Juventus into the quarter-finals.

Juventus had needed to attack their visitors, who had kept five clean sheets in a row coming into the game, to stand any hope of qualifying and went at them straight from the first whistle.

Chiellini had the ball in the back of the net after four minutes when Ronaldo challenged Oblak from a corner, but after a VAR review the referee ruled the ball had been kicked out of the goalkeepers hand and gave a free-kick.

The hosts constantly got the ball wide and terrorised Atletico full-backs Santiago Arias and Juanfran, but it was Bernadeschi’s untracked run into the middle which put them ahead on the night.

He crossed from deep for Ronaldo at the far post, who beat Juanfran in the air and powered beyond Wojciech Szczesny.

Ronaldo missed a free header before the break but it took him less than three minutes of the second half to pull the hosts level on aggregate when he turned Joao Cancelo’s cross towards the near post – a stunning save from Oblak could not prevent the ball crossing the line.

The onus suddenly shifted onto Atletico to attack, something they had given precious little thought to all game, but they had already wasted their only chance of the first half when an unmarked Alvaro Morata headed over from six yards.

Juventus huffed and puffed and looked like they were starting to run out of ideas themselves, especially following a reshuffle when Spinazzola was withdrawn with 25 minutes to go, but an inexplicable push in the back from substitute Correa on Bernardeschi gave them the perfect chance to seal a momentous comeback four minutes from time.

Ronaldo stepped up to score his 25th goal in 32 games against Atletico – who have now been knocked out of the Champions League by the team he has been playing for in five of the last six seasons.