Meanwhile, bitter rivals Barcelona made it two wins in as many games under Luis Enrique with a late winner at Villarreal yesterday.
Madrid were without the injured Cristiano Ronaldo and departed Angel di Maria and Xabi Alonso, but still looked on course for a comfortable evening when they flew into a 2-0 lead inside the opening 11 minutes thanks to goals from Sergio Ramos and Gareth Bale.
However, Inigo Martinez and David Zurutuza levelled for the hosts before the break and Zurutuza and Carlos Vela sealed a much-needed win for under-fire Sociedad boss Jagoba Arrasate.
Ramos rose highest to power home Toni Kroos' corner to open the scoring before Bale left Gorka Elustondo trailing with a neat nutmeg and slotted into the bottom corner.
Also Read
But it was the hosts who crucially got the third goal as Martinez slammed home at the far post from Xabi Prieto's flick on.
- Humiliation -
================
Iker Casillas produced a fine save to turn Imanol Agirretxe's header behind as Sociedad started the second period the stronger.
And they got their reward 25 minutes from time when Zuruztuza again timed his run into the box perfectly to connect with Prieto's low cross to the near post.
Madrid's humiliation was complete 10 minutes later when substitute Carlos Vela appeared to control the ball with his hand before spinning to fire into the top corner.