The Madrid clubs were drawn as opponents in the tournament’s round of 16 on Thursday.
Leganes eliminated Real Madrid in the quarterfinals last year, winning the second leg at Santiago Bernabeu Stadium. They will play the first leg there this season.
Sporting Gijon, the only second-division club still in the tournament, will play Valencia.
The first-leg matches of the round of 16 will be played the first week of January.
Video review will be used starting in this round.
Source: Fox Sports