Deportivo La Coruna are out of the Copa del Rey after losing 3-0 at home to second-tier side Mirandes.
Mirandes, who reached the semifinals in 2012, advanced to the quarterfinals 4-1 on aggregate.
Deportivo coach Victor Sanchez made sweeping changes for a second-leg tie from which the top-flight side were expected to progress, and he paid the price as Mirandes went into half-time ahead through a 41st-minute goal from midfielder Dani Provencio.
A 55th-minute free-kick from former Mallorca forward Abdon Prats made it 2-0 just after the restart, with a second by Provencio securing a famous victory for the Burgos club.
Daniel Provencio and Abdon Prats scored either side of half-time for the visitors before Provencio sealed matters with a second goal on 71 minutes.
Also on Tuesday, Sevilla cruised into the quarterfinals by defeating Real Betis 4-0 on Tuesday and advancing 6-0 on aggregate.
Jose Antonio Reyes put Sevilla ahead on the night with an early header, and Adil Rami added to the lead following a corner before the break.
Kevin Gameiro then scored after a counterattack, and Gael Kakuta closed the scoring from close range.
Betis, playing for the first time since sacking manager Pepe Mel, lost their fourth straight game.
Information from The Associated Press and Press Association was used in this report.