Real Madrid head coach Zinedine Zidane claimed his team did not deserve to be beaten by a stoppage-time goal from Espanyol at RCDE Stadium.
A much-changed Los Blancos, with Cristiano Ronaldo left out of the squad by Zidane, looked to have done enough to labour to a share of the points.
However, with more than two minutes of added time played, Espanyol broke clear and Gerard Moreno crashed the ball past Keylor Navas to give the Barcelona club a first win over Real Madrid since 2007.
Defeat leaves Real Madrid in third place, 14 points behind leaders Barcelona, who have a game in hand, and two ahead of Valencia having played one match more.
Espanyol's victory ended the visitors' seven-match unbeaten run, which had seen them pick up six victories and score 30 goals.
"We made a bright start and had some chances to score, but our second-half display was worse than the opening 45 minutes. We didn't manage to play at all or offer any sort of threat in the second half, although we didn't deserve to lose the game," Zidane said.
"Espanyol created few chances. It's a defeat that hurts and it's a poor result. I feel sorry for the players."
Zidane, though, did accept his much-changed team, which had captain Sergio Ramos back following suspension, "were lacking a little bit in all departments".
The French coach continued: "At times, there's no understanding football. We dropped further back for some spells in the second half, but you've got to accept these tough times.
"At no point in the second half did we do well. After five good results, today we didn't manage to extend the run."
Zidane also refused to be drawn on what impact Neymar's foot injury would have on the second leg of their Champions League tie against Paris St Germain.
"I don't know what will happen. We have to wait and see," the Real Madrid coach added.
"We know that he's picked up an injury and we do not know if he will be ready for the match against us or not."
Quique Sanchez Flores' men had drawn their last four matches to slip into the bottom six.
The Espanyol coach hopes his side can now use this result to build some upward momentum.
"We played with strength, energy, balance and when we find the things that made us grow last year, we improve," Flores said, quoted on the club's official website.
"As a team we needed a victory like that, against a good rival. It will help us to believe in ourselves and we will do well for the future."