Real Madrid's Spanish record 22-match winning streak ended in a 2-1 defeat at Valencia but they remained top of La Liga after a depleted Barcelona crashed 1-0 away to Real Sociedad on Sunday.
Real, who last dropped points against champions Atletico Madrid in mid-September, remain a point clear of Barcelona and have a game in hand.
Jordi Alba headed into his own net in the second minute to give Sociedad the lead against a Barca side with Lionel Messi and Neymar on the bench having only returned on Friday from their Christmas break.
Barca failed to link up well in attack and it was David Moyes' side that carried the greater threat on the counter for much of the game.
In the final stages, with Messi and Neymar on, Barca did begin to press but the San Sebastian hosts were resolute at the back.
"There is no point in saying what might have happened if they (Messi and Neymar) had started the game," Barca coach Luis Enrique told a news conference.
"I thought it was the right decision as I didn't want to take a risk with the players who had just returned from holiday and a long trip less than two days before. I decided to put them on in the second half.
"I don't think the result was just as we didn't deserve to lose but this is football and it can happen that you don't get the luck when you need it."
It was a memorable victory for former Manchester United manager Moyes, who has been Sociedad coach for less than two months and now sees his team move up to 13th with 18 points.
Real Madrid took the lead against Valencia after Alvaro Negredo handled a Toni Kroos free kick in the penalty area and Cristiano Ronaldo coolly placed the spot kick into the corner with 14 minutes played.
An Andres Gomes shot deflected off Dani Carvajal and hit a post in first-half stoppage time as Valencia battled back and Antonio Barragan then saw a shot deflect in off Pepe in the 52nd before Nicolas Otamendi nodded home a corner after 65 minutes.
"We have to give credit to Valencia. It's sad that we have dropped three points and our run has come to an end but the league is long," Real defender Sergio Ramos told reporters.
"Before we didn't say that we had it won and in no way are we now going to say we have lost the league.
"Valencia played their way and did very well. They packed players in the middle of the pitch and took the points."
It all looked good for Real early on with their lethal counter-attacking putting them ahead. Gareth Bale was brought down by Lucas Orban and from the resulting free kick, Real won the penalty.
The game, though, became feisty with plenty of chances for both sides and it was Valencia's greater drive that allowed them to turn the game around in the second half.
It was a poor start to the New Year for Real, who picked up their fourth piece of silverware in 2014 when they won the Club World Cup last month.