Madrid, Spain: Villarreal moved to within touching distance of qualifying for the Europa League after Mario Gaspar scored a late winner to beat rivals Valencia on Saturday.
Gaspar headed in Manuel Trigueros' free-kick in the 86th minute at Estadio de la Ceramica to secure a dramatic 1-0 win over Valencia, who have also sealed their place in next season's Champions League.
Valencia's place in the top four was guaranteed even before kick-off after Real Betis had earlier lost to Athletic Bilbao.
Villarreal's victory means they will be guaranteed to finish in La Liga's top seven if Getafe, in eighth, fail to beat Las Palmas on Sunday.
This season, the team that finishes seventh in the table will also qualify for the Europa League, as well as fifth and sixth, after Barcelona won the Copa del Rey.
Valencia had the better of the chances in the first half but Santi Mina missed a one-on-one with Sergio Asenjo and they were made to pay the price.
Trigueros swung in a cross from the left and Gaspar rose highest at the front post, flicking the ball with his head into the far corner.
Villarreal could still finish fifth after Athletic Bilbao beat Betis thanks to two goals in the final 15 minutes from Iker Muniain and Aritz Aduriz.
Celta Vigo's chances of playing European football next season are all-but over after they were held to a 1-1 draw by already-relegated Deportivo La Coruna. Girona's hopes were also diminished by a 4-1 defeat at home to Eibar.