In the first leg of the sides' fourth-round clash, a much-changed Real side were somewhat laboured in securing victory at Espanyol's Estadi Cornella-El Prat home, but did enough to secure a 10th consecutive triumph in all competitions.
Real made hard work of the first half, but were ahead at the break thanks to two Raphael Varane headers, which sandwiched a stunning equaliser from Cornella's lone striker Oscar Munoz.
The Liga giants' greater quality shone through after the interval as Javier Hernandez quickly established a two-goal cushion.
Real's fourth of the game, and 50th of the season, was scored by Marcelo and ensured a routine win for coach Carlo Ancelotti, who rested a host of key players including Cristiano Ronaldo, Toni Kroos and Luka Modric.
Cornella's part-timers will have a chance to impress at the Santiago Bernabeu in the tie's second leg - slated for mid-December.
The Liga side quickly hit the front as Varane rose unchallenged to firmly nod home James Rodriguez's inswinging corner.
Though camped firmly in their own half, Cornella found a response as a long heave out of defence was flicked infield and Alex Gallar prodded into the path of Munoz, who held off Alvaro Arbeloa's challenge and lashed past Keylor Navas.
Real were struggling to create opportunities as Cornella captain David Garcia - a dentist by trade - kept his midfield colleagues well drilled, Isco and Rodriguez routinely drifting in from the flanks only to find their path blocked.
Yet the visitors retook the lead with 10 minutes to go in the opening half, Varane again scoring from a corner - this time delivered by Isco - as Cornella goalkeeper Jose Segovia failed to get a fist on the ball.
Hernandez settled any remaining nerves five minutes into the second half, drifting across the 18-yard line before clipping a low angled shot beyond Segovia's reach and into the corner.
Second-half substitute Marcelo saw a cheeky backheeled effort saved, but the Brazilian claimed a goal with 20 minutes to go after following in Isco's parried shot to score from a narrow angle.
Ancelotti responded by withdrawing stand-in captain Karim Benzema and Isco - Raul de Tomas handed a debut in place of the former, while midfielder Alvaro Medran came on for his second outing at first-team level.
The youngsters appeared eager to impress, though they could not force Segovia into action, and the more senior members of the squad will return looking to keep Real's form up when they head to Granada in La Liga on Saturday.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.