Real Madrid have been handed a Copa del Rey tie with Melilla, who are based on the north coast of Africa.
The La Liga giants are looking to win the competition for the first time since 2014, and Julen Lopetegui's side will begin their efforts with a two-legged tie with third-tier outfit Melilla.
Real will travel to one of Spain's African enclaves at the end of October, before the return fixture takes place at the Bernabeu during the first week of December.
Holders Barcelona will go head to head with Cultural Leonesa, while current La Liga leaders Sevilla will go up against Villanovense.
Atletico Madrid play Sant Andreu, with Valencia being provided with a showdown versus Ebro.
Full draw:
Alaves vs. Girona
Almeria vs. Villarreal
Athletic Bilbao vs. Huesca
Cadiz vs. Espanyol
Celta Vigo vs. Real Sociedad
Cordoba vs. Getafe
Cultural Leonesa vs. Barcelona
Ebro vs. Valencia
Leganes vs. Rayo Vallecano
Lugo vs. Levante
Mallorca vs. Real Valladolid
Melilla vs. Real Madrid
Racing Santander vs. Real Betis
Sant Andreu vs. Atletico Madrid
Sporting Gijon vs. Eibar
Villanovense vs. Sevilla