Real, leading 1-0 from the first leg, took until the 82nd minute to go in front when Mezut Ozil put them ahead, but Emmanuel Adebayor then volleyed home his first goal for the club to make it 2-0 on the night and 3-0 on aggregate.
Goals from Adriano, Thiago Alcantara and Ibrahim Affelay gave Barcelona a 3-0 win over Almeria, making it 8-0 on aggregate.
It is the first time the two giants of Spanish football will have met at this stage since 1990, when Barcelona won 2-0.