Copa del Rey holders Barcelona have been drawn against third-tier Real Murcia in the last 32 of the competition.
The Blaugrana, who have won the trophy in each of the past three seasons, will begin their defence of the cup at the Nueva Condomina stadium.
Meanwhile, La Liga champions Real Madrid can look forward to a local derby against Fuenlabrada, a club from the suburbs of the Spanish capital who compete in the third tier.
The first leg will take place at the Estadio Fernando Torres, named after the Atletico Madrid striker and hometown hero.
Spain's other Champions League representatives also entered the draw, with Sevilla facing Cartagena and Atletico Madrid going up against second-division side Elche.
Athletic Bilbao face a trip to the Balearic Islands for a two-legged clash with Formentera, while in-form Valencia meet six-time champions Real Zaragoza.
The last-32 ties will be contested over two legs, with the opener scheduled for October 25 and the return leg to be played on November 29.
Copa del Rey last-32 draw in full:
Cartagena vs. Sevilla
Elche vs. Atletico Madrid
Murcia vs. Barcelona
Fuenlabrada vs. Real Madrid
Formentera vs. Athletic
Lleida vs. Real Sociedad
Ponferradina vs. Villarreal
Real Zaragoza vs. Valencia
Numancia vs. Malaga
Real Valladolid vs. Leganes
Cadiz vs. Real Betis
Tenerife vs. Espanyol
Getafe vs. Alaves
Deportivo La Coruna vs. Las Palmas
Girona vs. Levante
Eibar vs. Celta Vigo