(CNN) -- Gonzalo Higuain struck in time added on as Real Madrid rode their luck to move within three points of Primera Liga leaders Barcelona with a 3-2 win over Getafe at the Bernabeu.
Higuain scored twice as Real Madrid snatched a last-gasp victory to move within three points of leaders Barcelona.
Ten-man Real twice came from behind to keep the pressure on Barca who face Sevilla at home on Wednesday.
Former Real player Roberto Soldado put Getafe in front on 10 minutes with a header to stun home fans, but Higuain equalised seconds before the break after a bad defensive error.
Substitute Juan Albin put Getafe back in the driving seat with a 2-1 lead after 83 minutes but Guti equalised with a superb free-kick three minutes later.
Pepe was then sent off for kicking a rival and conceding a penalty, but Francisco Casquero's weak spot-kick was saved by Iker Casillas to his right -- and minutes later Higuain netted a dramatic winner.
Bayer Leverkusen booked their place in the German Cup final on May 30 at Berlin's Olympic Stadium, beating second-division Mainz 4-1 in Tuesday's semifinal.
It looked as though Leverkusen had won it after 82 minutes when Greek striker Angelos Charisteas pounced on the rebound to score after Renato Augusto had his shot saved.
But promotion hopefuls Mainz hit back just two minutes from time when striker Aristide Bance headed home to take the game into extra-time.
Chile midfielder Arturo Vidal restored the advantage for Leverkusen with an early strike in the first period and Simon Rolfes secured a place in the final after 104 minutes.
Czech defender Michal Kadlec completed the rout with a fourth goal in the 117th minute.
In Wednesday's semifinal, Hamburg host Werder Bremen in the first of four meetings between the sides in the next month -- twice in the UEFA Cup and again in the Bundesliga.