Sociedad and Levante win promotion
Xabi Prieto netted from the penalty spot just after half time and Carlos Bueno made sure of the win with a header in the 63rd minute to leave the team from San Sebastian top with 74 points with one game left to play.
Second-placed Levante, who were relegated in 2008, also secured promotion with a comfortable 3-1 victory over basement side Castellon and climbed to 71 points.
The Valencia-based club cannot overtake Sociedad as they have an inferior head-to-head record against their Basque rivals.
Third-placed Hercules and Real Betis in fourth fight it out for the last promotion slot next weekend. Both have 68 points.
Levante are promoted because, if all three sides finish level on 71 points, they already have more points than Betis in the three-way head-to-head reckoning.