TURIN, Italy — Alvaro Morata's stoppage-time winner booked Juventus a spot in the Champions League's knockout stage.

Combined with Cristiano Ronaldo's first-half equalizer, Morata's header earned Juventus a 2-1 comeback win over Hungarian side Ferencvaros on Tuesday.

Barcelona, which beat Dynamo Kyiv 4-0 in the other Group G game, also advanced.

Barcelona leads the group with 12 points and Juventus has nine points while Kyiv and Ferencvaros have one point each.

While Juventus has also laboured in Serie A with four wins and four draws under first-year coach Andrea Pirlo, it has not lost in either competition. Still, the club expects more from a team that has won nine straight Italian league titles.

“We had intended to start with a different attitude, but we know there can be difficulties in games that appear simple on paper,” Pirlo said. “We were too superficial at the start and had to chase the game.”

Bargain-buy Morata nodded down a cross from Juan Cuadrado for his seventh goal across all competitions this season and his fifth in the Champions League.

Ronaldo cut inside a defender and placed a shot inside the near post for the equalizer before the break — marking the 16th consecutive Champions League season that he has scored in.

It was Ronaldo’s 131st Champions League goal. The five-time Ballon d’Or winner missed Juve’s opening two Champions League matches this season after contracting the coronavirus.

Ronaldo has scored in six of his seven appearances for Juventus this season for a total of nine goals.

Myrto Uzuni had put Ferencvaros ahead on a counter-attack early on, taking advantage of the absence of Juventus defensive stalwarts Leonardo Bonucci and Giorgio Chiellini.

Danilo fell down while marking his opponent near midfield and Uzuni was able to redirect in a cross.

Federico Bernardeschi and Morata each hit the post for Juventus in the second half.

___

More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports