Holders Barcelona were knocked out of the Copa del Rey after suffering a 3-2 defeat in extra-time at Athletic Bilbao in the last 16 on Thursday as their bad season proceeded.
Athletic dominated a thrilling match and went on a lead early thanks to a wonderful cross-shot from Iker Muniain who curled the ball past Barca goalkeeper Marc-Andre ter Stegen into the top corner.
Former Manchester City forward Ferran Torres equalised for Barca with a splendid right-foot strike from the edge of the area, his first goal for the club.
Inigo Martinez set Athletic back in the lead after 86 minutes, winning a challenge against Gerard Pique to score, yet Pedri netted a fine goal in stoppage time to send the match into extra time.
Man-of-the-match Muniain scored the winner with a penalty after the video assistant referee spotted a handball from Jordi Alba inside the area.
Athletic joined Real Madrid, Real Sociedad, Valencia, Real Betis, Rayo Vallecano, Mallorca and Cadiz in the quarter-finals. The draw will occur on Friday.