The draw for the last-32 of the Copa del Rey took place at the headquarters of the Spanish Football Federation in Las Rozas on Friday morning.
All 20 La Liga sides join the competition at this stage with the seven European representatives facing the lowest ranked teams in the competition while the other 13 face sides from La Liga 123 or their fellow La Liga teams.
Holders Barcelona have been drawn against Cultural Leonesa who play their football in Group one of Segunda B while Real Madrid face a trip to the Spanish autonomous city of Melilla in the north of Morocco to take on local side UD Melilla.
Atlético Madrid face the lowest ranked team in the competition, Sant Andreu who play their games in the Tercera Division, the fourth tier of Spanish football. The fourth Champions League side, Valencia, will take on Ebro.
Europa League sides Real Betis and Sevilla face Racing Santander and Villanovense respectively while Villarreal take on Segunda side Almeria.
Celta Vigo vs Real Sociedad is arguably the standout tie of the round and one of four all La Liga clashes in the draw. Among the other three is a Madrid derby between Leganes and Rayo Vallecano while Athletic Bilbao take on Huesca and Alaves face Girona.
The ties take place over two legs and have been provisionally scheduled for the 31st of October and 5th of December but will likely take place over the days in and around those dates.
Copa del Rey Last-32 draw in full
CyD Leonesa vs Barcelona
Ebro vs Valencia
Sant Andreu vs Atlético Madrid
UD Melilla vs Real Madrid
Villanovense vs Sevilla
Racing Santander vs Real Betis
Almeria vs Villarreal
Mallorca vs Real Valladolid
Cadiz vs Espanyol
Sporting vs Eibar
Lugo vs Levante
Cordoba vs Getafe
Athletic Bilbao vs Huesca
Alaves vs Girona
Leganes vs Rayo Vallecano
Celta Vigo vs Real Sociedad