Real Madrid staged a late rally to take a huge step towards the last four of the Copa del Rey by beating Girona 4-2 at home in their quarter-final, first leg on Thursday thanks to goals from Sergio Ramos and Karim Benzema in a three-minute spell.
Madrid recovered from an early goal by Anthony Lozano to take a 2-1 halftime lead thanks to a Lucas Vazquez strike and a cheeky 'Panenka' penalty from captain Ramos but were pegged back by Alex Granell's penalty midway through the second half.
Girona's joy at having a second away goal for Thursday's second leg at the Montilivi stadium did not last long as Ramos struck again by heading home from a corner to restore the stuttering European champions' lead in the 77th minute.
Benzema then tapped the ball into the net at the near post in the 80th to give Madrid a two-goal cushion, increasing Santiago Solari's side's chances of reaching the semi-finals for the first time since they won the competition in 2014.
"The tie is still wide open, we would have liked to have kept a clean sheet but this is a good result," said Ramos.
"The second leg won't be easy, Girona knocked out Atletico Madrid) and scored three times against them. We've taken an important step today, but we have to finish the job over there."
Real are having a disappointing Liga campaign, having fallen 10 points behind leaders Barcelona, but looked to have turned a corner after last week's galvanising 2-0 win over Sevilla.
Coach Solari named a strong and experienced line-up for the game, recalling veteran left back Marcelo but again leaving out Isco, although the out-of-favour Spain international was to come off the bench to play a huge role in their rampant finish.
But it was Girona, playing in their first Copa del Rey quarter-final after dumping Atletico out in the previous round, who grabbed a seventh-minute lead when Honduran forward Lozano turned in a cross from close range on the volley.
Madrid struck back in the 18th thanks to a marauding run down the right wing from full back Alvaro Odriozola which led to fellow Spaniard Vazquez lashing the ball high into the net.
The home side had a penalty appeal waved away when Luka Modric went down in the area but were eventually awarded a spot-kick after exciting Brazilian teenager Vinicius Jr was tripped, and Ramos converted with his cheeky 'Panenka' penalty.
A shot from Benzema licked the outside of the post as Madrid finished the half strongly and after the interval again looked determined to add their lead but instead found themselves level due to a moment of madness from midfielder Marcos Llorente.
Llorente threw his arm into the air while defending a corner and handled the ball, allowing Alex Granell to equalise with a powerful strike into the top corner.
But Madrid, who got an injection of creativity from Isco, roared back to life, delivering two potentially fatal blows.