Twice former winners Benfica came from behind to beat Manchester United 2-1 in Lisbon on Wednesday to reach the last 16 of the Champions League and end the English side's interest in Europe this season.

In a dramatic end to the group phase, Champions League debutants Villarreal finished as Group D winners above Benfica after defeating Lille 1-0 in Spain.

Werder Bremen thrashed Panathinaikos 5-1 to grab the last available slot after Barcelona's late 2-0 win at Udinese ended the Italian side's hopes in Group C.

Swiss outsiders Thun gained reward for a spirited first season with the big boys by securing a place in the UEFA Cup after their goalless draw at Sparta Prague put them above the Czechs in Group B.

KNOCKOUT STAGE

United, who beat Benfica to lift the first of their two European Cups in 1968, were bidding to reach the knockout stage for a record 10th successive season but needed a victory to be certain.

They made the ideal start with a Paul Scholes goal after six minutes but their hopes of a first away win in the competition for more than two years nosedived when Geovanni headed an equaliser in the 16th.

Benfica, who began the day bottom of the group, immediately grew in confidence and took the lead with a deflected Beto shot after 34 minutes.

Despite dominating possession after the break, United never really looked likely to grab an equaliser that would have been good enough to send them through after the Villarreal result.

"It's a big success, this is not an experienced Benfica team said victorious coach Ronald Koeman.

"After the initial draw was made, United were the big favourites but I think the best teams in this group have gone through."

United manager Alex Ferguson said: "It's a low moment as we have prided ourselves on our performances in Europe over the last 13 years.

"We were in a winning position at 1-0 but gave it away by losing possession.

"Our home form has let us down." Villarreal seized the only goal against Lille when substitute Guayre showed neat control to score in the 67th minute.

"The team found it had to deal with the fact that we were favourites to make the knockout stage and it took us some time to find the rhythm and confidence that eventually brought us the goal," said Villarreal coach Manuel Pellegrini.

Lille, who managed only one goal in their six group games had to settle for a UEFA Cup slot.

Bremen raced into a 3-0 first-half lead against Panathinaikos with two goals by Nelson Valdez after a second-minute Johan Micoud penalty.

Miroslav Klose notched the fourth after 51 minutes but it was all looking of little use as Udinese held on against Barcelona.

The Italians, also Champions League debutants, got to within five minutes of the last 16 before Santiago Ezquerro and Andres Iniesta won it for Barcelona.

That opened the door for Bremen, who capped a 5-1 win with an injury-time Torsten Frings goal.

"We were lucky. We knew we had to do what we could here and then hope," said Klose, who played in a mask after breaking a bone in his face last month.