Two goals from Giuseppe Rossi rescued Villarreal against Odense to put the Liga side into the Champions League group phase.
Danes Odense were one of three teams who failed in their bid to qualify for the first time, along with Wisla Krakow and Malmo.
Villarreal, facing a 1-0 first leg deficit against Odense, struggled to break the deadlock until Rossi struck twice in 16 minutes in the second half.
The Italian, linked with Juventus in the close season, got in front of his marker to open the scoring five minutes after halftime and then rifled in a brilliant volley in the 66th minute. Carlos Marchena added the third goal.