Despite their dominance, the unbeaten hosts found themselves trailing just nine minutes into the second half when Thibaut Courtois inadvertently redirected Jofre Carreras’ cross into his own net.
However, Espanyol’s unexpected lead lasted only four minutes. A pass from Jude Bellingham slipped under goalkeeper Joan Garcia, allowing Dani Carvajal to score into an empty net.
The turnaround was completed with 15 minutes to go when Rodrygo connected with Vinicius Junior’s cross, and just three minutes later, substitute Vinicius added a third goal. Kylian Mbappe capped off the scoring with a late penalty.
The hosts launched 14 shots in a frustrating first half, with Mbappe coming closest when his close-range effort was saved by Garcia.
Carlo Ancelotti’s team ended the match with a total of 31 attempts, compared to just one from Espanyol, which came in the 68th minute. Real Madrid remained composed even after going behind.
Mbappe, now with six goals in his first eight matches since joining from Paris St-Germain this summer, assisted Vinicius with a perfectly timed through-ball before converting a penalty awarded after Endrick was fouled by Carlos Romero.
The victory moved Real Madrid up to second in La Liga, with four wins in their first six matches, just one point behind leaders Barcelona, who will face Villarreal on Sunday with an unblemished record.
Ancelotti’s side has also matched the second-longest unbeaten streak in La Liga history, trailing only Barcelona, who went 43 league games unbeaten between 2017 and 2018.