Match ends, Leganés 1, Real Madrid 3.
Real Madrid came from behind to win at Leganes and go third in La Liga.
Cristiano Ronaldo was rested for the game, while Gareth Bale was named on the bench and the hosts took a surprise lead when Unai Bustinza scrambled in.
Leganes had knocked Real out of the Copa del Rey earlier this season, but the visitors quickly equalised through Lucas Vasquez.
Casemiro then put Zinedine Zidane's side ahead before Sergio Ramos converted a late penalty.
It continued an impressive recent run of form for Real Madrid.
The Spanish giants have won their last four games in a row - including a 3-1 Champions League last-16 first-leg win against Paris St-Germain - and have scored 16 goals in the process.
However, Real have 48 points from 24 games and trail leaders Barcelona 14 points.
Line-ups
Leganés
Formation 4-2-3-1
- 1CuéllarBooked at 85mins
- 2Román Triguero
- 3Bustinza
- 22SiovasSubstituted forMantovaniat 45'minutes
- 15RicoBooked at 51mins
- 8Appelt Pires
- 6GumbauSubstituted forPérezat 45'minutesBooked at 86mins
- 10El Zhar
- 17Eraso
- 23RamosSubstituted forN Amrabatat 72'minutes
- 12Beauvue
Substitutes
- 5Mantovani
- 7N Amrabat
- 9Guerrero
- 13Champagne
- 14García
- 20Zaldua
- 21Pérez
Real Madrid
Formation 4-2-3-1
- 13Casilla
- 2Carvajal
- 5Varane
- 4RamosBooked at 57mins
- 15Hernández
- 14Casemiro
- 23KovacicSubstituted forCeballosat 90+2'minutes
- 17Vázquez
- 22IscoSubstituted forLlorenteat 87'minutes
- 20Asensio
- 9BenzemaSubstituted forBaleat 76'minutes
Substitutes
- 6Nacho
- 11Bale
- 18Llorente
- 19Hakimi
- 21Mayoral
- 24Ceballos
- 30Zidane
- Referee:
- José Luis González González
- Attendance:
- 11,423
Match Stats
- Possession
- Home40%
- Away60%
- Shots
- Home7
- Away13
- Shots on Target
- Home3
- Away7
- Corners
- Home6
- Away5
- Fouls
- Home18
- Away7
Live Text
Post update
Full Time
Second Half ends, Leganés 1, Real Madrid 3.
Substitution
Substitution, Real Madrid. Dani Ceballos replaces Mateo Kovacic.
Post update
Attempt missed. Nordin Amrabat (Leganés) left footed shot from outside the box is close, but misses to the left. Assisted by Nabil El Zhar.
Goal!
Goal! Leganés 1, Real Madrid 3. Sergio Ramos (Real Madrid) converts the penalty with a right footed shot to the bottom right corner.
Post update
Penalty Real Madrid. Mateo Kovacic draws a foul in the penalty area.
Post update
Penalty conceded by Diego Rico (Leganés) after a foul in the penalty area.
Post update
Daniel Carvajal (Real Madrid) wins a free kick in the defensive half.
Post update
Foul by Claudio Beauvue (Leganés).
Post update
Attempt missed. Gareth Bale (Real Madrid) left footed shot from the left side of the box misses to the right. Assisted by Lucas Vázquez.
Post update
Corner, Real Madrid. Conceded by Martín Mantovani.
Substitution
Substitution, Real Madrid. Marcos Llorente replaces Isco.
Booking
Rubén Pérez (Leganés) is shown the yellow card for a bad foul.
Post update
Isco (Real Madrid) wins a free kick in the attacking half.
Post update
Foul by Rubén Pérez (Leganés).
Booking
Iván Cuéllar (Leganés) is shown the yellow card.
Post update
Attempt blocked. Isco (Real Madrid) right footed shot from the left side of the box is blocked. Assisted by Gareth Bale with a headed pass.
Post update
Corner, Real Madrid. Conceded by Martín Mantovani.
Post update
Attempt saved. Isco (Real Madrid) right footed shot from the centre of the box is saved in the bottom right corner. Assisted by Gareth Bale.
Post update
Marco Asensio (Real Madrid) wins a free kick in the defensive half.