Atletico Madrid was given a shock by fourth-tier Cacereno before winning their second round of the Copa del Rey tie 3-1 on Thursday night.
Atletico fell behind against a team that plays in the RFEF II division after Alvaro Merencio finished a swift attack in the 30th minute and didn't level until Clement Lenglet nodded home just seven minutes from time.
Cacereno was reduced to 10 men in the 88th minute after Jaime Sancho was sent off for a professional foul, and Atletico took the lead in the 92nd minute thanks to Rodrigo de Paul's deflected shot.
Julian Alvarez scored Atletico's third goal two minutes later to put Atletico in the hat for Monday's third-round draw.
Osasuna had an even more amazing escape after they trailed 2-0 away to Ceuta with just six minutes left to play.
Ante Budimir gave the top-flight side a lifeline with six minutes left to play, and Raul Garcia made it 2-2 in the 87th minute before Redru, who had earlier scored for Ceuta, put the ball into his own net early in injury time to give Osasuna a 3-2 win.
Getafe squeezed into the third round after 120 minutes away to Orihuela failed to produce a goal. Orihuela then missed all their penalties in the resulting shootout, which Getafe won 3-0.
Sevilla had an easier night with a 3-1 win away to fourth-tier Olot, although the home side missed a penalty before Gonzalo Montiel put Sevilla ahead from the spot.
Juanlu Sanchez and Kelechi Iheanacho sealed the win before Oriol Ayala's late consolation for the home side.
Brais Mendez's goal in the second minute of extra time gave Real Sociedad a nervy 1-0 win away to Conquense, who play in the fourth tier of the Spanish game.
New Alaves coach Eduardo Coudet had a disastrous start at the club as they were knocked out of the cup by fourth-tier Deportivo Minero 4-2 in a penalty shootout after 120 minutes ended 2-2.
Kike Garcia forced extra time for Alaves with two goals after Jose Mas and Sandji Bernal had twice put Minero ahead, and the home side was able to force penalties after David Morante was sent off.