CD Leganés is a club that for most of its history lived in the shadow of its far larger neighbours from the Madrid region. It was founded on 23 June 1928 at a meeting held in Madrid, but the town it represents is Leganés, in the southern suburbs of the capital. Its first president was Ramón del Hierro, and Félix Pérez de la Serna is named as the founder. The club's nickname, Los Pepineros (The Cucumber Growers), has become a trademark of its modest, local image. For decades it competed in regional and lower divisions, and in the 1930s it reached the second-level Preferente category of the Madrid federation. In 1977 it regained promotion to the fourth tier, where it had already played earlier.
The modern club was shaped slowly. In 1995 it was converted into a sports public limited company, and after a decade in Segunda División B it returned to professional football in 2013–14. The arrival of the Basque coach Asier Garitano in 2013 is regarded as a turning point, and under him the club grew steadily. On 4 June 2016 it sealed promotion to La Liga for the first time in its history with a 1–0 win away to CD Mirandés. It thus became only the fifth club from the Community of Madrid to play in the top flight, after Real Madrid, Atlético Madrid, Rayo Vallecano and Getafe. The local rival remains Getafe, and the matches between the two form the South Madrid derby.
In its first top-flight spell, which lasted four seasons from 2016, Leganés finished 17th in 2016–17 and 17th in 2017–18, and in 2018–19 it reached its best league placing so far, 13th. The most memorable moment of the era came in the Copa del Rey in 2017–18. In the quarter-finals the club eliminated Real Madrid, winning 2–1 at the Santiago Bernabéu, in a tie in which the Argentine goalkeeper Nereo Champagne was one of the heroes. It was the first time Leganés had reached the semi-finals of the competition, and there it lost narrowly to Sevilla. For a club celebrating its 90th anniversary that year, it remains the most important result in its history. That first stay in the top flight ended in 2020, when relegation was confirmed on the last day of the season with a 2–2 draw at home to Real Madrid, the newly crowned champions.
The club's recent history has been a pattern of ups and downs. After returning to La Liga it finished 18th in 2024–25 and was relegated again, and it has since played in the Segunda División. The Copa del Rey has been a source of memorable nights even in that period. In the 2024–25 edition Leganés beat Atlético Madrid at home and then met Real Madrid at the quarter-final stage, which showed that the club retains a particular ability to trouble larger opponents in a single match.
The team plays its home matches at the Estadio Municipal de Butarque, built in 1998 to replace the old ground, Luis Rodríguez de Miguel, in the centre of town. It originally held around 8,000 spectators and was expanded after the promotion of 2016. Its commercial name has changed, but for supporters it remains simply Butarque. The club plays in white and blue. In a region dominated by two of the biggest clubs in the world, Leganés represents a very different model: a suburban side that built its place in the top flight step by step, and whose cup victories over giants remain a part of its identity.