(CNN) -- Bundesliga side Hamburg have finished top of UEFA Cup Group F after defeating Premier League high-flyers Aston Villa 3-1 in the final round of matches.
Petric celebrates Hamburg's opening goal in their 3-1 UEFA Cup victory over Aston Villa.
With qualification for the final 32 already assured, Villa manager Martin O'Neill played a weakened side -- and he was made to pay for that decision as Hamburg strikers Ivica Olic and Mladen Petric proved the difference between the two sides.
Hamburg went ahead in the 18th minute when Petric superbly controlled a long pass from Piotr Trochowski before firing a left-footed volley past goalkeeper Brad Guzan.
Ten minutes later, Hamburg doubled their lead. Marcell Jansen supplied the ball out to Dennis Aogo on the left flank and his cross into the danger area saw Olic get in front of Carlos Cuellar and angle his header past Guzan via the inside of a post.
Jansen crashed a shot against the crossbar just before half-time, but the home side added a third 11 minutes after the restart when Joris Mathijsen launched a 60-yard pass into the Villa half which Cuellar looked favorite to win -- but Olic nicked the ball away from him and drilled a low shot past Guzan.
Nathan Delfouneso scored a consolation goal for Villa eight minutes from time from a Moustapha Salifou center, but a minute later the visitors had Steve Sidwell sent off after a second yellow card.
The result means Hamburg finish with nine points and will play a third-placed side from the group stages, while Villa finished third in the group on six points and must face a group winner in the knockout stages.
Ajax, who had also sealed their qualification prior to Wednesday's matches, go through as runners-up, and will play a team dropping down from the Champions League, after a 2-2 home draw with Slavia Prague.
Elsewhere, Deportivo La Coruna, Lech Poznan and FC Copenhagen all won their final group matches 1-0 to clinch their places in the next round.
In Group H, Deportivo La Coruna beat Nancy 1-0 thanks to a late Rodolfo Bodipo winner and that result prevented the French club qualifying with Polish side Lech Poznan winning at bottom club Feyenoord to take third place and the final qualification spot.
CSKA Moscow, who did not play on Wednesday, had already secured their place as group winners with a maximum 12 points.
There was a surprise in Group E where AC Milan drew 2-2 at home to Wolfsburg, a result that saw the Bundesliga side go through as group winners with the Italian giants finishing second in the group.
Mahir Saglik scored with nine minutes left to earn Wolfsburg the point that ensured a prime draw in the last 32 stage.
Massimo Ambrosini put Milan ahead with a header from Clarence Seedorf's corner, but Italian international Cristian Zaccardo equalized. Substitute Alexandre Pato restored Milan's lead before Saglik pounced.
In the other match, Portsmouth beat Heerenveen 3-0 courtesy of two Peter Crouch goals, but neither side go through as Sporting Braga of Portugal, who did not play, take third spot.
In Group G, Copenhagen took the only spot still up for grabs when Brazilian forward Cesar Santin scored in the 58th minute at Bruges to knock out the Belgian side.
St Etienne and Valencia were already through and faced each other in France to see who toppped the group. The Spanish side needed a win, but the match ended 2-2 meaning they also face a team from the Cahmpions League.