Leganés, a modest club from the Madrid suburbs, reached the quarter-finals of the Copa del Rey for the first time in their 89-year existence on Wednesday.
Despite losing 2-1 at Villarreal, who are currently sixth in La Liga, Leganés progressed on away goals having won the first leg 1-0.
Moroccan international Nabil El Zhar scored the crucial away goal for mid-table Leganés on the half-hour mark.
In the night's other early second leg tie, last season's runners-up Alaves downed third division Formentera 2-0 for a 5-1 aggregate win.
Later Wednesday, Real Madrid should comfortably progress at home to second division Numancia having already won the first leg 3-0.
On Thursday, three-time defending champions Barcelona host Celta Vigo with the two sides locked at 1-1.