Cristiano Ronaldo enjoyed a record-equalling night for Real Madrid, while Getafe and Real Zaragoza both won in the battle to avoid relegation.
Ronaldo scored twice to draw level with former Real striker Hugo Sanchez (1989/90) and former Athletic Bilbao forward Telmo Zarraonandia, known as Zarra (1950/51), on 38 goals in one Primera Liga season.
Marcelo had opened the scoring in a 3-1 victory for Real Madrid against Villarreal, whose goal came from Cani.
Villarreal cannot now overtake third-placed Valencia and must enter next season's UEFA Champions League at the final qualifying round.
Valencia, meanwhile, played out a goalless draw with Levante despite being up against ten men for much of the game following Xisco Nadal's sending-off in the first half.
Barcelona, already confirmed as champions, also drew 0-0 at home to Deportivo La Coruna as Pep Guardiola took the opportunity to rest most of his key players.
An own goal from Miguel Flano and a late Pedro Rios strike secured a 2-0 victory for Getafe against Osasuna.
Getafe therefore stay one point clear of the bottom three, but Real Zaragoza kept their hopes alive after beating Espanyol 1-0 thanks to Leonardo Ponzio's goal.
Espanyol's loss also ensured that Athletic Bilbao, Sevilla and Atletico Madrid would all compete in the Europa League next season.
Athletic Bilbao came from behind to draw 1-1 with in-form Malaga as David Lopez's penalty cancelled out Jose Recio's opener.
Frederic Kanoute scored twice and Alvaro Negredo also got on the scoresheet as Sevilla overcame Real Sociedad 3-1.
Already-relegated Hercules were beaten 2-1 by Atletico Madrid as goals from Alvaro Dominguez and Jose Antonio Reyes trumped a solitary effort from David Trezeguet.
Bottom club Almeria saw off Real Mallorca 3-1 as Kalu Uche, Juanma Ortiz and Pablo Piatti found the target.
Sporting Gijon came from behind to beat Racing Santander 2-1 as Miguel de las Cuevas and Nacho Novo strikes overtuned Fernandez Christian's opener.