The Dons did lead the second leg tie 2-1 shortly after the break before a brace of late goals sealed a comfortable victory for Real.
Two goals up from the first leg, Real extended their advantage in the 28th minute as Xabi Prieto headed home from a corner.
Yet the hosts were level shortly before half-time thanks to Peter Pawlett who latched onto Niall McGinn’s mis-struck shot.
And 12 minutes into the second half the Scottish side went ahead when McGinn’s cross was firmly headed home by Mark Reynolds.
Willo Flood grazed the bar for Aberdeen while Ruben Pardo went close for the visitors.
That was the way it remained until Shaleum Logan tripped Alberto De La Bella five minutes from time and Prieto clipped home the equaliser from the penalty spot.
To add insult to injury, Marke Bergara headed Real’s third of the night, via a Sergio Canales cross, to earn the La Liga side a comfortable win.