Manchester United had to settle for second place in the UEFA Champions League Group H after suffering a 2-1 defeat at Valencia while Manchester City topped Group F by beating Hoffenheim at home on Wednesday.

Carlos Soler fired the La Liga side ahead and an own goal from Phil Jones early in the second period doubled their lead. Second-half substitute Marcus Rashford made it 2-1 in the 87th minute.

The result meant Jose Mourinho’s men finished as the runners-up in the group after Juventus, who topped the group with two more points despite losing 2-1 against Young Boys in Switzerland.

Mourinho was pleased with Manchester United’s progression to the last 16 although it was already secured before the final match.

He said, “I don’t think we were brilliant in this group phase, but with the problems we had and the injuries we had we managed to come here already qualified.”

Two goals from Leroy Sane saw Manchester City fight back from falling behind to overcome Hoffenheim and seal top spot in Group F.

The German side took a first half lead through Andrej Kamaric’s 16th minute penalty, but Sane brought City level against his compatriots with a stunning free-kick in first half injury time.

The winger then capped a fine man-of-the-match performance by finding the target again midway through the second half to seal the win and secure pole position for Pep Guardiola’s men.

Lyon settled for the second behind City and secured the final last-16 spot after playing to a 1-1 draw with Shakhtar Donetsk in Kiev thanks to a second-half goal from Nabil Fekir.

Real Madrid suffered their worst ever defeat in the Champions League when they were beaten 3-0 in the Santiago Bernabeu Stadium by CSKA Moscow.

The Russians had beaten Madrid 1-0 in Moscow earlier in the competition but were not expected to do the same in Madrid’s home ground.

Real Madrid still finishes top of their group, but Viktoria Plzen’s 2-1 win over Roma means that CSKA Moscow fails to qualify for the Europa League despite their win.

Bayern Munich topped Group E despite being held to a 3-3 draw by Ajax in a match that saw two red cards and two penalties.

Robert Lewandowski gave Bayern the lead but Dusan Tadic equalized. Maximilian Wober was sent off for Ajax, with Bayern’s Thomas Muller dismissed for kicking Nicolas Tagliafico’s head.

Tadic then put Ajax ahead with an 82nd-minute penalty, but there were three goals to come. Lewandowski scored a spot-kick with Bayern’s Kingsley Coman netting before Tagliafico levelled the score five minutes into the stoppage time.

Bayern topped Group E with the draw, although Ajax would have overtaken them if they had held on to their 2-1 lead.

In the group’s other match, Benfica beat AEK Athens 1-0.