Zenit St Petersburg booked a Europa League place with a 1-0 win away to a depleted AC Milan side thanks to a first-half goal by captain Danny in their final Champions League Group C match on Tuesday.
Massimiliano Allegri's Milan, already in the last 16 of the Champions League by finishing second, made eight changes to the side that won 3-1 at Catania in Serie A on Friday.
They still dominated the match but, apart from a penalty appeal after four minutes when Giampaolo Pazzini seemed to be fouled by Bruno Alves, Milan created few chances until they brought on their first choice strikers late in the game.
Zenit opened the scoring after 35 minutes when Danny snapped up a loose ball from a weak tackle and stroked home the decisive goal that ensured the Russian side finished above Anderlecht, who came bottom of the group after a 2-2 draw at Malaga.
Milan came close to equalising in the 73rd when Bojan Krkic embarked on a fine piece of dribbling but let the ball run away from him just before he could shoot and the resulting clearance flew past Pazzini's outstretched leg.
Milan brought on their Brazil forward Robinho and Serie A top scorer Stephan El Shaarawy to try to get something from the game and they each had a chance to level the score.
Robinho went close with a curling right foot strike after 83 minutes and two minutes later El Shaarawy dragged an effort wide with his left foot but it was too little too late.
Zenit held on for the win that secured third spot in the group and a place in the Europa League with seven points, one behind the Italians and two ahead of Anderlecht. Champions league debutants Malaga topped the group with 12 points.
"I'm disappointed that we lost, but the team played well. We conceded the goal from the first chance we gave them," said Allegri.
"They committed 10 more fouls than us and when you commit more fouls it means that you're nearer the ball, in for more tackles.
"We might have had more of the ball, but when it came to tackles we weren't aggressive enough and, in fact, that's how they scored their goal."
Milan midfielder Mathieu Flamini, who started only his fourth game this season, added: "It's a shame because we played well, created chances but couldn't get that shot away.
"We're disappointed because we created the play, we kept the ball well but they scored that goal after which they put themselves behind the ball and played defence."
Berlin will stage Champions League final for the first time in 2015
Borussia Dortmund's Mario Gotze ruled out of Champions League final against Bayern Munich
Manchester United centre-back Rio Ferdinand signs one-year contract
Malaga coach Manuel Pellegrini will leave the La Liga club at the end of the current season
Ten years on, the legends speak to FFT
Your questions answered by an A to Z of legends
He's here, he's there, he's...
The cost of Premier League away travel
Nike CR7 IX for you
FourFourTwo is brought to you by Haymarket Consumer Media & FourFourTwo is part of Haymarket Sport
| International Licensing | © Haymarket Media Group 2010