The Basque club had won the first leg of the last-32 tie 3-2 in Irun and were trailing 4-2 at the Bernabeu when Eneko Romo buried a header past keeper Jerzy Dudek in the 90th minute to oust the home team.

The 17-times Cup winners made a lethargic start and were soon behind after striker Abasolo was left unmarked to fire past Dudek.

Raul equalized with a looping header before the break and scored again just after the restart.

He tapped in from Javier Saviola's pass a minute after Salcedo had sprinted clear to put Union back in front 2-1.

Madrid substitute Alberto Bueno swept in a glorious 25-meter shot to level the tie on aggregate and Raul looked to have sealed the win when he completed his hat-trick, his cross sailing past everyone and into the net with four minutes to go.

But Madrid's defense, who leaked three goals at home to promoted Malaga in the league on Saturday, were caught out again at the end when Romo struck.

On Wednesday, 13 more matches will be played with Villarreal trying to overturn a 5-0 first-leg deficit at home to third division Poli Ejido.