Antoine Griezmann scored the only goal for Sociedad, who also had Markel Begara sent off late on, and the win coupled with Valencia's defeat at Sevilla ensured a top-four finish.
Depor had started the day outside of the relegation zone but results went against them on the final day and they finished the season second-bottom in the table.
It was nothing to lose and all to gain for both teams at Riazor and within the first minute Sociedad goalkeeper Claudio Bravo was tested by Juan Dominguez's right-footed strike.
Carlos Alberto Vela tried his luck for the visitors after six minutes with a shot from 25 yards out, but Depor goalkeeper Daniel Aranzubia was equal to the challenge.
Griezmann was the next player to threaten as Sociedad looked to take a stranglehold on the match, but he pushed his shot wide of the right post.
However, the French forward enjoyed greater success after 22 minutes. Imanol Agirretxe dinked his way past several defenders before getting in a shot which was parried by Aranzubia but only as far as Griezmann, who stuck the ball into the bottom left corner.
Sociedad had the ball in the back of the net again after 31 minutes with a similar move which saw Griezmann finish on the rebound after Aranzubia had saved Agirretxe's shot, but this time the Frenchman was offside.
Depor responded with an attempt from Riki to chip Bravo, which forced the keeper to pluck the ball away from the top-right corner.
However, the Griezmann-Agirretxe partnership continued to pose problems at the other end and the former squared the ball to his partner, who deserved better than to spoon the ball over the bar.
Despite Depor's desperate situation, the home side were unable to stamp their mark in the second half and with 20 minutes gone they had only half attempts from Luiz Pizzi and Riki to their name.
They should have been level after 75 minutes, though, as Diogo Salomao headed wide of an empty net with Bravo nowhere in sight, and minutes later Riki saw his header hit the crossbar after a poor clearance from the Sociedad goalkeeper.
Depor needed to win to be sure of staying up and they were given a helping hand six minutes from time when Begara was shown a second yellow card for a challenge on Riki.
However, they were unable to capitalise and the final whistle brought scenes of despair among the home players while Sociedad celebrated securing their place among Europe's elite.