Madrid - Barcelona and Real Madrid avoided each other in the quarter-finals of the Copa del Rey while giant-killing Mirandes drew Villarreal on Friday.
La Liga leaders Madrid will play at home to Real Sociedad while Barca, who have won the cup four times in the last five years, face a tricky trip to Athletic Bilbao.
Mirandes sit 10th in Segunda but stunned Sevilla with a 3-1 win on Thursday and their reward is a home tie against Villarreal.
Defending champions Valencia will travel to Granada.
The matches will be played on February 4, 5 and 6 ahead of the two-legged semi-finals in February and March.
Copa del Rey quarter-finals:
Real Madrid v Real Sociedad, Athletic Bilbao v Barcelona, Granada v Valencia, Mirandes v Villarreal