Madrid - Holders Barcelona will face Sevilla in the quarter-finals of the Copa del Rey after a complaint that they fielded an ineligible player in the last round was thrown out by the Spanish Football Federation (RFEF) on Friday.
The current leaders of La Liga have won the trophy in each of the last four years and qualified for the last eight with a 3-0 win over Levante on Thursday.
That secured a 4-2 aggregate victory in their last-16 tie, but Barcelona's place in Friday's draw looked to be under threat after they were accused of fielding defender Juan Brandariz 'Chumi' in the first leg when he should have been suspended for an accumulation of bookings picked up playing for Barca's B team.
Levante lodged a complaint, but it was thrown out by the RFEF because it was not submitted within 48 hours of the first leg finishing.
Levante have said they will appeal, but Barca are now set to go to Sevilla in the first leg next midweek for a repeat of last season's final.
Barcelona won that game 5-0 at the Wanda Metropolitano stadium in Madrid.
Real Madrid, who were thrown out of the 2015-16 Copa del Rey after fielding the ineligible Denis Cheryshev in a tie against Cadiz, will play Girona in the quarter-finals.
Girona knocked out Atletico Madrid in the last 16 this week, advancing on away goals after a 3-3 draw in the capital.
The other ties will see Getafe face Valencia and Espanyol take on Betis.
Copa del Rey quarter-final draw
Real Madrid v Girona
Getafe v Valencia
Sevilla v Barcelona
Espanyol v Real Betis