VILLARREAL, Spain (AP) — A smart piece of improvisation by Cristiano Ronaldo helped send Manchester United into the last 16 of the Champions League as Michael Carrick’s spell as the English club’s interim manager began with a 2-0 win at Villarreal on Tuesday.

Scoring his fifth goal of this group stage and 140th overall in the competition, Ronaldo adjusted his feet and lobbed the goalkeeper with a first-time effort in the 78th minute after Fred won the ball back high up the field.

Jadon Sancho then scored his first goal since his $100 million move to United, firing in off the underside of the crossbar in the 90th minute at the end of a sweeping counterattack that used to be a feature of the team under Ole Gunnar Solskjaer.

Solskjaer is now gone, fired on Sunday following a run of woeful results that culminated in a humiliating 4-1 loss at Watford in the Premier League on Sunday.

Carrick, one of Solskjaer’s assistants, is filling in as a replacement until a more long-term interim is found and he put his stamp on the team by dropping Bruno Fernandes and starting Donny van de Beek.

Carrick oversaw a disciplined if limited performance by United until Ronaldo sparked an explosive ending with his 140th goal in the competition. He has scored in all five group-stage matches this season.

United moved onto 10 points, three more than Villarreal, and was guaranteed of advancing as the winner of Group F thanks to Atalanta drawing 3-3 at Young Boys later Tuesday. Villarreal can finish tied on points with United but has an inferior head-to-head record, which is the tiebreaker.

Whether Carrick will still be in charge then remains to be seen, but he has made a strong start to his interim tenure — even if David De Gea kept United in the game with two great saves to deny Manu Trigueros either side of halftime.

In the first half, United sat off Villarreal and was opened up at times, with Ronaldo virtually anonymous playing mostly on the left of a front three with Sancho on the right and Anthony Martial.

He came to life in the second half and his goal was stunning after Fred dispossessed Etienne Capoue following an ill-advised pass out from the back by goalkeeper Gerónimo Rulli.

Ronaldo swivelled and placed his right-footed lob over Rulli just inside the near post.

Fred also sparked the break that was finished by Sancho in ruthless fashion following a lay-off from Fernandes, who came off the bench in the 66th.

“It’s massive for our season," United captain Harry Maguire said. “The last couple of months have been nowhere near good enough and we needed to get a result for our season and our fans. We need to make sure that’s just the start and we push on.”

___

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