Diego Forlan scored his 32nd Primera Liga goal of the season to help Atletico Madrid secure a place in Champions League qualifying with a 3-0 win over visiting Almeria on Saturday.
Abel Resino's side had needed only a draw to fight off the challenge from fifth-placed Villarreal, who won 3-2 at Real Mallorca thanks to a double from Joseba Llorente.
Champions Barcelona, runners-up Real Madrid and third-placed Sevilla had already secured the three automatic places in Europe's elite club competition.
Barca closed out their treble-winning season with a 1-1 draw at Deportivo Coruna, after Samuel Eto'o grabbed a late equaliser for his 30th goal of the campaign.
Villarreal will play in the Europa League, which replaces the UEFA Cup from next term.
They will be joined by Valencia, who made sure of sixth spot thanks to David Villa's 27th and 28th goals of the season in a 2-0 win over visiting Athletic Bilbao.
Deportivo finished just outside the Europa League places in seventh, four points behind Valencia.
Forlan's goal, a typical long-range effort, added to strikes from Sergio Aguero and Raul Garcia to seal a sixth consecutive win for Atletico and the Uruguayan striker is almost certain to win a second European Golden Shoe award.
It was his 12th goal in Atletico's final eight matches of the season and he wins Spain's "Pichichi" award as top scorer.
Former Atletico goalkeeper Resino, who took over from Mexican Javier Aguirre at the start of February, said he would discuss whether he would stay on as coach with the club's board on Monday.
"I am happy and calm because we have achieved our aim," he said at a news conference. "I am in no rush and we will now sit down and see what the situation is."
The final day of the season on Sunday starts with Osasuna, Sporting Gijon, Real Betis, Getafe and Real Valladolid separated by two points and scrapping to avoid the one remaining relegation place.
Recreativo Huelva and Numancia have already been relegated.