Di Maria on target as Madrid, Barcelona triumph in King's Cup
Atletico, who beat Real 2-1 in last season's final, climbed to the top of La Liga at the weekend but their first defeat in all competitions since October means they face a stiff task in Tuesday's second leg at the Calderon.
After a cautious opening from both sides, Atletico playmaker Arda Turan had the first genuine chance when he tested Real goalkeeper Iker Casillas with a header in the 13th minute.
Real were ahead four minutes later when centre back Pepe galloped forward and his speculative shot hit Emiliano Insua, wrong footed Atletico keeper Thibaut Courtois and ricocheted into the net.
Atletico defender Diego Godin headed over the bar when well placed early in the second half but Real doubled their lead just before the hour when a superb Angel Di Maria pass released Jese and he poked the ball past Courtois.
Luka Modric cleared another Godin header off the line in the 72nd minute and Real landed a stunning blow a minute later with another deflected effort.
Di Maria let fly from distance and the ball struck Atletico defender Miranda before spinning past the helpless Courtois.
Barcelona meanwhile, with Javier Mascherano and Lionel Messi on the field, prevailed in the Camp Nou over the Basques Sociedad. Sergio Busquets opened the scoring in the first half, and the lead was doubled after the break with an unfortunate own goal from Enaut Zubikarai.