At the other end of Spain’s top flight, Granada made a late charge for a place in the Europa League with a 4-0 victory over Athletic Bilbao, who finished 11th.
Granada’s triumph meant Getafe, who went down to a 109th-minute goal from Coke against Levante, dropped out of the top seven.
A 4-0 win over Eibar saw Villarreal consolidate their place in fifth, with the Yellow Submarine four points above Granada and Real Sociedad, who snatched a late 1-1 draw at Atletico Madrid to be sure of their European qualification.