In a dramatic final day of the 2012/13 La Liga season Deportivo La Coruna, Real Mallorca and Real Zaragoza were relegated while Valencia finished just outside of the Champions League places and Real Sociedad secured their spot in the European continents biggest club competition.
Real Zaragoza's four-year stay in the La Liga ended on Saturday night as they slipped to a 3-1 defeat at the hands of Atletico Madrid in a game where all the scoring came in the final six minutes.
Celta Vigo's 1-0 defeat of Espanyol rendered the result of the contest irrelevant and Arda Turan's late strike appeared set to decide the contest in Atletico's favour.
Helder Postiga, though, equalised in the 89th minute, but a miserable night for the hosts at La Romareda was capped off by two injury-time goals from Diego Costa.
Atletico were assured of third place before kick-off and this result means they end the campaign with the best away defensive record in the league.
Natxo Insa scored the only goal in Celta Vigo’s game as they survived relegation.
Celta Vigo stayed up at the expense of Deportivo La Coruna, who were relegated after being beaten 1-0 at home by Real Sociedad, who edged a tight game to secure their place in the Champions League.
Antoine Griezmann scored the only goal for Sociedad, who also had Markel Begara sent off late on, and the win coupled with Valencia's 4-3 defeat at Sevilla ensured a top-four finish.
Alvaro Negredo scored all four Sevilla goals in the seven-goal thriller which saw Valencia finish just outside the Champions League places.
Valencia finished the season in fifth, and a place in the Europa League, after goals from Ever Banega and a Roberto Soldado double were not enough to secure the win they needed to claim fourth spot.
For Sevilla, their ninth place finish this win provides could also see them compete in the Europa League next season - at least subject to appeals lodged by Malaga and Rayo Vallecano against their respective continental bans.
Elsewhere, Getafe's faint hopes of European football melted away as they finished with a 2-0 defeat away to Granada while Levante's bid to join Real Betis in Europa League qualification failed at the final hurdle as the two sides played out a low-key 1-1 draw at Estadi Ciutat de Valencia.
Betis, though, can reflect on an impressive season that has delivered a seventh place finish and the prize of a place in the Europa League qualifiers.
Real Mallorca finished on a winning note (4-2) but it was not enough to prevent them from being relegated to the Segunda Division.
The Balearic Island outfit came into the last round of fixtures bottom, needing a win over mid-table Real Valladolid and for results elsewhere to go their way if they were to avoid the drop.
Rayo Vallecano were forced to settle for an eighth place finish after being held 2-2 draw at home by an Athletic Bilbao side who played almost the entire match with a man less.