Holders Barcelona will face resurgent Valencia in the other last-four tie.
On Wednesday Real crashed to a humiliating exit when they were knocked out by little Leganes in the quarter-finals, adding to the atmosphere of crisis at the European champions.
Real lost 2-1 in the second leg at their Bernabeu home as the tie finished 2-2 on aggregate with their modest city neighbours going through on away goals despite having lost the first leg 1-0 last week.
Leganes’s next opponents Sevilla beat Atletico Madrid 5-2 on aggregate.
Barcelona, who have won the Copa del Rey in the last three seasons, progressed to the semis 2-0 against Espanyol on Thursday courtesy of goals from Lionel Messi and Luis Suarez for a 2-1 aggregate win.
Barca’s rivals Valencia secured their last four tickets with a 3-2 penalties win over Alaves after their tie ended 3-3 on aggregate.
The semi-final first legs will be staged on January 31-Feb 1 with the second legs on Feb 7-8.