The Catalans face a Barcelona derby in their search for a place in the semis.
Barcelona have been drawn against Espanyol in the Copa del Rey Quarter Finals.
Ernesto Valverde’s men must travel to the RCDE Stadium before returning for the second leg at the Camp Nou.
The first leg fixture will be played between the 16th and 18th of January while the second leg will be competed between the 23rd and 25th of the same month.
Barcelona secured passage into the next round after a 5-0 demolition of Celta de Vigo on Thursday and are looking for their 30th Copa title.
Espanyol, meanwhile, qualified for the quarters after a 3-2 aggregate win over Levante.
The draw in full:
CD Leganes – Real Madrid CF
RCD Espanyol – FC Barcelona
Atlético de Madrid – Sevilla FC
Valencia CF – Deportivo Alavés