Valverde scored with a stunning volley at the back post to give Madrid an early lead, and Camavinga extended their advantage with a powerful header after just 13 minutes.
Endrick came close to adding a third for Los Blancos before Guler pounced with the aid of a deflection after cutting in from the right.
Brahim Diaz hit the post early in the second half before 39-year-old midfielder Modric notched with a neat curling effort.
Guler finished with ease at the death after Fran Garcia teed him up to cap a fine night for the Turkish playmaker.
On Saturday Barcelona and Atletico Madrid also eased into the next round, while holders Athletic Bilbao scraped through on penalties against third-tier Logrones.
Listen to the latest songs, only on JioSaavn.com
The draw for the next round takes place on Wednesday, with the fixtures due to take place between January 14-16.
Advertisement
(This story has not been edited by staff and is auto-generated from a syndicated feed.)