Takefusa Kubo, a former Madrid winger, and Ander Barrenetxea scored goals for Real Sociedad, who reinforced their hold on fourth place and qualification for the Champions League.
To make matters worse for Los Blancos, Madrid defender Dani Carvajal was dismissed after an hour for receiving a second yellow card.
Tuesday saw Barcelona increase its lead over Madrid with a 1-0 victory over Osasuna, and Carlo Ancelotti’s team was unable to respond.
La Liga: Barcelona thrashes Athletic club
Due to injuries and bans, the Italian fielded a weakened lineup, while Karim Benzema was left in Madrid ahead of Saturday’s Copa del Rey final matchup with Osasuna.

In the first period, Alex Remiro stopped Madrid defender Eder Militao, and Martin Zubimendi’s close-range shot hit the crossbar at the other end.
After Militao gave the ball away in a risky area, the hosts’ Kubo scored to open the second half.
Messi called Suarez on FaceTime as soon as he entered the changing room to thank him
Madrid faced an uphill battle after Carvajal was expelled for a foul on Real Sociedad forward Mikel Oyarzabal.
Thibaut Courtois, the goalkeeper for Madrid, did well to parry a deflected Barrenetxea shot, but the attacker surprised the Belgian at his near post with his subsequent attempt.
Barcelona run riot against Real Betis
Due to Los Blancos’ loss, Barcelona now just needs two more points to win their first championship since 2019, if Madrid wins their remaining games.