In the 2015–16 season, for the first time in their history, Leganés earned promotion to La Liga, which was sealed on 4 June 2016 with a 1–0 away win against CD Mirandés. They remained in the top flight for four seasons, reaching a peak of 13th in 2018–19, before relegation in the last game of the following season, a 2–2 home draw with Real Madrid. Ending Lega's four-year stint in the first tier. During this spell, the team qualified for the first time to the semifinals of the Copa del Rey, by eliminating Real Madrid in the quarterfinals thanks to a 2–1 win at Santiago Bernabéu Stadium.