MILAN (AP) — Liverpool made it a perfect six in the Champions League group stage by winning 2-1 at AC Milan as the Italian team’s return to Europe’s premier club competition came to a swift end on Tuesday.

Milan needed a victory to have any chance of qualifying for the knockout stage in its first appearance in the competition since the 2013-14 season and things appeared to be going to plan when Fikayo Tomori scored in the first half.

But Mohamed Salah kept up his impressive scoring streak and fired Liverpool level seven minutes later. And a Tomori howler gifted Divock Origi and Liverpool the winner in the 55th minute.

That saw Liverpool become part of an elite list of clubs to qualify for the knockout stage with a perfect record, and the first English team to do so.

Atlético Madrid was the other team to qualify from Group B after winning 3-1 at Porto, which was consigned to the Europa League. Milan, a seven-time European champion, finished bottom of the group.

Both teams in Milan were without a number of first-choice players: the Rossoneri because of an ever-lengthening injury list and Liverpool through choice, with manager Jürgen Klopp making eight changes to the team that beat Wolverhampton 1-0 on Saturday.

Liverpool dominated possession from the outset in Milan but it was a cautious start from both teams with chances few and far between.

Milan broke the deadlock in the 29th minute and it was an Englishman who scored against an English team. A corner was flicked on at the near post and Liverpool goalkeeper Alisson Becker had to make a save to prevent an own goal, but Tomori prodded home the rebound.

Liverpool almost immediately equalized but Mike Maignan did well to keep out a fierce strike from Origi, who had scored Saturday’s winner.

However, the visitors didn’t have to wait long. Maignan could only parry an effort from Alex Oxlade-Chamberlain and Salah fired the rebound into the roof of the net to render the boisterous home fans silent.

It was Salah’s 11th goal in his past 11 Champions League matches. The Egypt forward also became the first player to score at least 20 goals for Liverpool in five successive seasons since Ian Rush in the 1980s.

And Tomori went from hero to villain 10 minutes into the second half when he gave the ball away on the edge of his own penalty area. Maignan was able to parry the shot from Sadio Mané but could do nothing on Origi’s follow-up header.

Milan upped the pressure but never really threatened and its winless streak at San Siro in the Champions League continued — since a 2-0 victory against Celtic in September 2013.

___

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