Real Madrid and bitter rivals Atletico Madrid will duel for a place in the Copa del Rey semi-finals after being paired in the last eight.
Los Blancos survived a scare on Thursday as they came from 2-0 down at Villarreal to win 3-2 thanks to goals from Vinicius Junior, Eder Militao and Dani Ceballos.
It ensured Carlo Ancelotti's team bounced back from losing to Barcelona in the Supercopa de Espana final four days earlier.
Nevertheless, their route does not get any easier with Thursday's draw pitting them against city rivals Atletico at the Santiago Bernabeu.
Diego Simeone's side beat Levante 2-0 in Valencia on Wednesday, with Alvaro Morata and Marcos Llorente scoring in the second half.
It will be the first time Atletico and Madrid have tussled in the Copa since January 2015, when the former emerged 4-2 aggregate winners over two legs.
The competition remains on track for a Clasico final, though Barca will also have to get past tricky opponents to reach the last four.
Real Sociedad, who have won each of their past eight games in all competitions and are third in LaLiga, will visit Camp Nou.
La Real have a dreadful record away to Barcelona, however, last winning there in LaLiga way back in 1991.
The other two quarter-finals are also all-LaLiga affairs.
Last season's beaten finalists Valencia will meet Athletic Bilbao at the Mestalla Stadium, while Osasuna – conquerors of defending champions Real Betis – play host to a Sevilla side who are battling relegation in the league.
The matches are scheduled across Tuesday, Wednesday and Thursday next week.
Copa del Rey quarter-final draw in full:
Barcelona v Real Sociedad
Osasuna v Sevilla
Real Madrid v Atletico Madrid
Valencia v Athletic Bilbao