Deportivo La Coruna came back from 2-0 down away at champions Barcelona to spoil a homage to Xavi Hernandez at the Camp Nou and stay up with a 2-2 draw along with Granada who held Atletico Madrid 0-0 at home yesterday.
That point was enough to ensure Atletico go straight into next season's Champions League group stages in third, whilst Valencia twice came from behind to win 3-2 at Almeria and secure fourth.
Eibar's remarkable first season in the top flight didn't have fairy tale ending as they were relegated despite just a second win in 20 matches 3-0 at home to Cordoba due to their inferior head-to-head record with Deportivo and Granada.
Xavi was making his 505th and final Liga appearance after announcing he will join Al Sadd at the end of the season after Barca face Athletic Bilbao and Juventus in the Copa del Rey and Champions League finals respectively.
Also Read
"I am the happiest man in the world today and for the 17 season I have been here," he told the crowd after fighting back tears.
"As the coach has said this hasn't finished. We want two more titles and we want to be here with you all again in Barcelona on June 7 (after the Champions League final)."
The Catalans dominated for large swaths of the game and looked to have sealed the Galicians fate when Neymar unselfishly squared for Messi to make it 2-0 on the hour mark.