Celta finished on 37 points while Mallorca had 36 after a 4-2 home win over Real Valladolid.
Deportivo, who had started the day in a safe position, ended on 35 and Zaragoza were bottom with 34.
Atletico Madrid's Diego Costa scored twice in a 3-1 win at Real Zaragoza as the Copa del Rey winners finished third with 76 points.
Real Sociedad snatched fourth place, and the Champions League playoff slot, from Valencia.
Antoine Griezmann earned Sociedad a 1-0 win at Deportivo La Coruna while four goals from Alvaro Negredo helped Sevilla sink 10-man Valencia 4-3 at the Sanchez Pizjuan.
"We are very satisfied," said Sociedad coach Philippe Montanier who has already agreed a move to Stade Rennes in his native France.
"It is the second time in recent years Sociedad have qualified for the Champions League and it was with a French coach again," he added referring to Raynald Denoueix.
Sociedad ended on 66 points. The three Europa League places went to Valencia in fifth, Malaga in sixth and Real Betis in seventh.
Malaga's participation in Europe depends on them winning their appeal to the Court of Arbitration for Sport as they bid to overturn a UEFA one-year ban for delays in payments to creditors.
Valencia held fourth place at the start of the day and looked to be on course for a return to the Champions League when Ever Banega put them in front with a spectacular solo effort after 12 minutes.
But they lost control of the game in a mad five-minute spell before the break.
Negredo netted with an overhead kick and scored a second from the penalty spot soon after. Valencia then had striker Jonas harshly sent off just before halftime.
Valencia captain Roberto Soldado volleyed an equaliser off the bar but a minute later his Spanish international team mate Negredo completed his hat-trick with a tap in.
Negredo bagged his fourth of the game and 25th in La Liga this season to put the game beyond Valencia and perhaps seal the fate of visiting coach Ernesto Valverde, who had told the squad before the game he was leaving.