The visitors now lead the two-legged tie 2-1 on aggregate and are on course to meet either Sevilla or Atletico Madrid in the final.
Early on tonight it was Barcelona who threatened and Lionel Messi dragged a right-footed shot just wide from a tight angle inside 90 seconds.
Madrid had the opportunity to take a shock lead in the 13th minute when Cristiano Ronaldo just had Gerard Pique to beat and did a pair of stepovers to put the Spaniard off-balance before sprinting past him and tumbling under his sliding challenge.
The Real number seven picked himself up and sent Jose Manuel Pinto the wrong way to put Los Blancos in front.
Ronaldo then stung the palms of Pinto with a long-range shot before, at the other end, Andres Iniesta's effort from a similar distance flew wide.
As half time approached, Barca again were fuming with Undiano when Ramos appeared to barge Pedro off the ball inside the box but no penalty was awarded.
Alvaro Arbeloa saw yellow for a lunge on Iniesta and from the resulting free kick Messi fizzed a curling effort around the wall but inches wide of the post.
Away goals do count in the Copa del Rey so if Madrid net another then Barca will require three.