Despite being rated higher, Real Madrid did not start smoothly when center back Antonio Rudiger had to leave the field due to injury in the first minutes.
The visitors remained in control of the game, but it wasn't until the 39th minute that they had their first shot on target, with a tricky finish from Jude Bellingham. However, the ball couldn't get past the Espanyol goalkeeper.
In the second half, Real Madrid increased the pressure but could not convert the chances into goals. Kylian Mbappe had a shot hit the post; Dani Ceballos and Vinicius also missed favorable situations.
It seemed like the match would end in a draw, but in the 85th minute, Espanyol unexpectedly counter-attacked successfully. Omar El Hilali crossed the ball accurately for Romero to make a lucky volley, when the ball hit Federico Valverde, changed direction and flew into the far corner of the goal.
Despite trying to attack in the final minutes, Real Madrid could not find an equalizer.
Espanyol surprisingly won 1-0, temporarily escaping the relegation group.
Real Madrid with 49 points face a tense championship race when they are only 1 point ahead of Atletico Madrid.
This defeat is a serious warning for coach Carlo Ancelotti and his students, as they prepare to enter the important Madrid derby next weekend.