Osasuna and Real Valladolid were relegated from the Primera Division on a dramatic closing day of the season.
Real Valladolid knew that their fate was not in their own hands and a 1-0 loss to Granada, who were also in danger of the drop at kickoff, confirmed that they would be in the second tier next season.
Osasuna needed Valladolid to defeat Granada to give them a chance of stopping up and were relegated despite beating Real Betis 2-1 in a match which was suspended for more than 35 minutes after a frightening incident in which a section of fencing collapsed, injuring a number of supporters.
Almeria were also in danger of going down on Sunday, but a goalless draw against Athetic Bilbao was enough to see them safe.
Stefan Mitrovic's own-goal a minute before the break was enough to settle the contest in Valladolid, with the real drama unfolding at Osasuna's El Sadar stadium.
Oriol Riera put the hosts on their way in the 12th minute before Javier Acuna doubled Osasuna's advantage two minutes later. Betis defender Chica reduced the arrears in the 70th minute, but the visitors could not find the equaliser.
Riera's opening goal sparked wild celebrations, but they were abruptly halted when a lower guard rail behind the goal gave way. Several fans fell forward and the match was immediately halted as the emergency services rushed to provide treatment.
It was reported that five supporters were taken to hospital, but none of their injuries were said to be serious. It was more than half-an-hour before the match resumed, and the decision was made to postpone second-half kick-offs elsewhere, with so much riding on Sunday's matches.
Away from the relegation battle, Villarreal produced a dominant performance to claim a 2-1 victory at Real Sociedad and unseat the Basques to finish sixth.
Man of the match Giovani dos Santos gave the visitors a deserved lead with a fine curled finish after 26 minutes and then the Mexican provided Ikechukwu Uche with the pass for the second goal on 69 minutes which killed off the game.
Carlos Vela got a goal back for the hosts in the third and final minute of injury time, but it left far too little time to find an equaliser.
Ciprian Marica scored an injury-time penalty to hand Getafe a 2-1 win away at Rayo Vallecano.
Marica had opened the scoring two minutes before the break, but Roberto Trashorras equalised before Ruben Martinez felled Sammir in the area to set up a dramatic finish.