Espanyol and Barcelona are both paired in the Copa del Rey quarter-finals, while Leganes and Real Madrid lock horns in a mini-derby.
The Catalan rivals were last drawn together in the last 16 two years ago, while Leganes have reached this stage for the first time in their history.
Elsewhere, Atletico Madrid take on Liga rivals Sevilla and high-fliers Valencia face struggling Alaves.
The first legs will be played between January 16-18 before the return fixures a week later.
Copa del Rey quarter-final draw:
Leganes v Real Madrid
Espanyol v Barcelona
Atletico Madrid v Sevilla
Valencia v Alaves