Victor Lopez and Mikel Alonso were the guilty pair for the Basque team, scoring at the wrong end in the 20th and 82nd minutes respectively as their side was condemned to the Segunda Division.

But it all could have been different after Gaizka Garitano fired them into an early lead before David Villa instantly hit back.

Argentinian Lopez then handed the advantage to the hosts before Inigo Diaz de Cerio gave Sociedad hope.

Alonso's mistake then made it 3-2 to Los Che with another own goal, this time from Emiliano Moretti, handing Sociedad a share of the spoils.

However, even a win would not have ensured the visitors' safety as their relegation rivals Real Betis, Athletic Bilbao and Celta Vigo all won.

Heading into the tie, Valencia had already secured fourth place and Champions League football for next season and coach Quique Sanchez Flores opted to field a side mainly made up of youngsters, who more than lived up to expectations in a riveting first half.

The visitors though took the lead after just two minutes.

A cleverly-taken corner by Savio Bortolini from the right saw him play the ball to Garitano just outside the penalty area and the midfielder beat of one challenge before rifling the ball home from 25 yards, giving Ludovic Butelle no chance in the Valencia goal.

But the lead lasted just three minutes when an attacking throw-in by David Corcoles was met by a powerful shot from Villa which flew into the net.

Jorge Lopez and Savio then exchanged wayward long-range efforts before Garitano almost snatched back the lead, when another corner by his Brazilian team-mate was followed by a close-range header which was kept out by the post.

The hosts were gifted the advantage via an own goal from Victor Lopez in the 20th minute, the defender right-footing the ball beyond his goalkeeper from 12 yards.

De Cerio twice came close to equalising with long-range shots as the visiting team poured forward in search of a leveller which eventually came in the 36th minute.

A free-kick by keeper Asier Riesgo made its way to Darko Kovacevic, whose flicked header picked out De Cerio on the left side of the penalty area and he fired the ball beyond Butelle to draw his side level at the break.

The second half started at a quick pace and Villa and Jorge Lopez both fired wide, while a melee in the Valencia penalty area almost gave the visitors the lead with Butelle coming to the rescue with a commanding punch.

Eight minutes from time, Riesgo was beaten for the second time by one of his own players, this time Alonso.

But deep into injury time Moretti did the same at his end to hand the visitors a share of the spoils.