Ramos opened the scoring with a header -- his 11th goal of the campaign -- with nine minutes gone after the Real Madrid captain was left unmarked for Isco's ball into the box. Pesky Leganes would not go away though, and equalised before half-time when Bryan Gil Salvatierra shot low past goalkeeper Alphonse Areola.
Asensio restored Madrid's lead early in the second half, Isco again providing the assist with a through ball. Leganes substitute Roger Assale then levelled late on and the hosts could have won the game and avoided relegation had they been awarded a penalty for an apparent handball by Luka Jovic.
With the league title already in the bag, there was little riding on this match for Real Madrid. Their only requirement was to get through the game without suffering any injuries and begin preparations for their all-important Champions League clash with Manchester City in three weeks.
Players who have contributed supporting roles over the last month -- the likes of Isco and Asensio -- were given time to impress, while others who have made no impression at all such as Brahim Diaz and Jovic were able to end the season with some minutes.
While this fixture didn't matter to Real Madrid, it was everything for Leganes, who were fighting for their lives at the bottom of the table. Madrid came under sustained, increasing pressure as the game went on, and the home side could easily have taken all three points by the final whistle.
Manager rating out of 10
His selections all made sense -- the likes of Modric and Kroos were in desperate need of a rest -- but the result was a lack of control and leadership that became even more obvious when Ramos was withdrawn at half-time.
Player ratings (1-10; 10 = best, players introduced after 70 minutes get no rating)
GK Alphonse Areola, 7 -- A first La Liga start since November and just his fourth of the season. Saved well from Salvatierra in the first half but was later beaten by the same player. Had a busier, better second half.
DF Eder Militao, 6 -- Started out looking comfortable against a Leganes team who offer little in attack but the game ended up being much, much more complicated. Still lacks authority and composure.
DF Sergio Ramos, 7 -- Played the first half and has now scored six times since the restart. His 11 goals this campaign are the most by a La Liga defender this century.
DF Ferland Mendy, 7 -- Made one clever first-half pass for Asensio. There are signs his left-sided partnership with Vinicius Junior could be one for the future. Sat back more as the team did.
MF Casemiro, 6 -- Played an hour, and the team really found it difficult when he went off.
MF Isco, 8 -- Picked up two assists, his delivery finding Ramos for the opener before a beautifully weighted pass played in Asensio for the second.
FW Marco Asensio, 8 -- Has now made nine appearances since the restart and scored three goals. Zidane is a fan and you suspect that if Asensio stays fit, he'll have an important role to play next season.
FW Vinicius Junior, 7 -- Had his moments running at the Leganes defence but nothing like the decisive form we saw last month.
DF Nacho Fernandez, 7 -- Back from injury and replaced Ramos at half-time for his first appearance since February.
FW Brahim Diaz, 6 -- His third substitute appearance of the last month. Showed some nice touches on the right wing and could have scored a third but put it over the bar.
FW Luka Jovic, 5 -- Played half an hour, his only on-the-pitch action of note since February, and could have given away a penalty.
MF Toni Kroos, 6 -- Came on for the last 30 minutes, initially improving the midfield, before fading amid the late Leganes onslaught.