Real Sociedad pipped Valencia to the final Champions League berth in La Liga on Saturday night, while Deportivo La Coruna were relegated.
Valencia held a two-point advantage heading into the last day but they saw that overturned after being beaten 4-3 at Sevilla - Alvaro Negredo netting all four goals for the home side - while Sociedad won 1-0 at Deportivo La Coruna.
Antoine Griezmann scored the only goal of the game in the 22nd minute as Sociedad, who lost Markel Bergara to an 84th-minute red card, secured a top-four finish in the top flight for the first time since 2003.
The result also consigned Depor to relegation.
Valencia, meanwhile, have to content themselves with Europa League football next season after losing a seven-goal thriller at the hands of Sevilla.
Negredo, who this week was omitted from Spain's provisional squad for this summer's Confederations Cup, struck in the 41st, 44th (pen), 57th and 61st minutes for Sevilla, with Valencia responding through Ever Banega (12) and Roberto Soldado (56 and 86).
In the fight against relegation, Real Zaragoza and Real Mallorca joined Depor in dropping out of the division as Celta Vigo came out top in the four-way battle to avoid the drop.
Celta secured their status as a 15th-minute Natxo Insa goal earned them a 1-0 win over Espanyol, who had Juan Forlin sent off late on.
Mallorca finished on a winning note after beating Real Valladolid 4-2 but it was not enough for them to extend their 16-year stay in the Primera Division.
Mallorca's goals came from Alejandro Alfaro (17), Jose Luis Marti (43), Giovani Dos Santos (58) and Javi Marquez (68) with Alberto Bueno (30) and Omar Ramos (72) replying for Valladolid.
Zaragoza also bade farewell to the top flight after losing 3-1 at home to third-placed Atletico Madrid in a match where all four goals were scored in the final six minutes.
Diego Costa struck twice in injury time for Atletico after Helder Postiga's 89th-minute goal had cancelled out Arda Turan's late opener for the Copa del Rey winners.
Real Betis finished seventh after drawing 1-1 at Levante, Jorge Molina's 67th-minute equaliser for the visitors levelling up Pedro Rios' strike just after half-time.
Granada beat Getafe 2-0 with goals from Manuel Agudo Nolito and Youssef El Arabi.
Rayo Vallecano were forced to settle for eighth after being held 2-2 at home by an Athletic Bilbao side who played almost the entire match with a man less.
Rayo must now wait to see if they will be able to play Europa League football next season after the Spanish Football Federation denied them the UEFA licence they need to compete in Europe because of outstanding debts.
The club have declared their intention to take their case to the Court of Arbitration for Sport if they qualify for Europe and if they had finished seventh they would in theory have been entitled to an automatic place in the Europa League. Eighth place could yet see them qualify for Europe if Malaga's UEFA ban is upheld, and Rayo's is lifted.