(CNN) -- After their fractious Champions League meeting in midweek, Barcelona and Real Madrid both suffered shock defeats in La Liga on Saturday.
Barcelona went down 2-1 away to Real Sociedad while Real Madrid crashed to their second defeat in four days at the Bernabeu losing 3-2 to relegation-threatened Real Zaragoza.
Real's second home defeat of the season completed a miserable week for Jose Mourinho as he saw his team's La Liga title ambitions peter out.
The visitors took a two-goal lead thanks to goals from Spanish winger Angel Lafita who scored four minutes before halftime and then Gabi converted a 55th minute penalty after Ricardo Carvalho had brought down Lafita.
Madrid pulled one back seven minutes later when Sergio Ramos headed home from Mesut Ozil's corner, but the expected comeback didn't materialize as Zaragoza restored their two-goal advantage 13 minutes before the end when Lafita netted his second of the night.
French striker Karim Benzema pulled one back again for the home side with six minutes remaining but when Carvalho received his second yellow card moments later Madrid couldn't respond.
Barcelona, who kicked off after the Madrid had lost, could have all but sealed their third title in as many years with a win against 12th-placed Sociedad.
Things initially went according to plan as Thiago gave Barcelona the lead in the 29th minute lead.
There could have been a second midway through the second half but Gabriel Milito's effort was ruled out for offside.
Thereafter, Barca's fortunes began to change as Uruguayan striker Diego Ifran equalized in the 71st minute. That was followed by a Xavier Prieto goal from the penalty spot eight minutes from time.
Barca tried to unlock the Sociedad defense in the final ten minutes but their efforts were in vain as the home side defended stoutly to complete a famous win and hand Barca their first away defeat of the league season.
Barcelona face Real Madrid in the second leg of their semifinal Champions League tie at the Nou Camp on Tuesday.
In the other game played on Saturday, Atletico Madrid overcame Deportivo La Coruna 1-0 to move up to fifth place in the table ahead of Athletic Bilbao, who play Espanyol on Monday and Sevilla, who are away to Almeria on Sunday.