MADRID, June 17 (Reuters) - Real Sociedad and Celta Vigo were relegated from the Primera Liga after a heart-stopping final round of games on Sunday.
Sociedad dropped out of the top flight for the first time in 40 years after drawing 3-3 at Valencia while Hristo Stoichkov's Celta will join them in the second division despite a 2-1 victory at home to Getafe.
Real Betis avoided the drop thanks to a 2-0 win at Racing Santander, both goals coming from Brazilian forward Edu in the last 10 minutes, while Athletic Bilbao were saved from their first relegation after a 2-0 win at home to Levante.
Already-relegated Gimnastic Tarragona will end the season at the bottom of the standings no matter what happens in their late match at home to Barcelona.
Real Sociedad finished the season with 35 points and Celta on 39, one behind Athletic Bilbao and Betis.
Celta looked to have escaped the drop when they came from a goal down to take a 2-1 lead over Getafe after Argentine defender Matias Lequi steered in a header at the near post following a free kick in the 67th minute.
But their hopes of survival were dashed by Brazilian forward Edu who scored two late goals to earn Betis their win at Racing Santander.
Betis discarded coach Luis Fernandez after last weekend's 5-0 defeat at home to Osasuna and former reserve team coach Paco Chaparro was in charge for their final game of the season.
Sociedad had to win and hope their rivals slipped up but although they took the lead after just two minutes they ended up scoring two own goals as they drew 3-3 at Valencia.
Fellow Basque side Athletic Bilbao have never been out of the top division in their 109-year history but they had an anxious time against Levante.
A series of brilliant reflex saves by Jose Molina kept Athletic at bay in the first half but the Levante keeper was final beaten when defender Jose Manuel Serrano turned an Aritz Aduriz cross into his own net on the hour.
The fears of the 40,000 fans crammed into San Mames were finally laid to rest when Igor Gabilondo put Bilbao 2-0 up with a far-post header 13 minutes from time.