Leganes will take a slender 2-1 lead into the second leg of their Copa del Rey fourth-round clash with Granada.
The Segunda Division outfit went in front with 10 minutes on the clock when Guillermo stole possession in the box and drove the ball home.
Granada were dealt a blow in the 24th minute when Ruben Perez was shown the red card, and things quickly went from bad to worse for the top-flight side.
Omar Ramos smashed home Leganes's second from long range after being lined up by Ruben Pena, giving the hosts a two-goal cushion at the interval.
The La Liga outfit gave themselves a lifeline to take into the return leg in a fortnight when Fran Rico guided the ball over the line following a corner in the 74th minute, and 2-1 was how it stayed.