With some help from defender Sergio Ramos in attack, Real Madrid overcame an early scare against Girona to move into position to reach the Copa del Rey semifinals for the first time in five years.
Ramos twice gave Madrid the lead in a 4-2 win against a gritty Girona team that had opened the scoring less than 10 minute into the match at Santiago Bernabeu Stadium on Thursday in the first leg of their quarterfinal.
"I'm going through a great phase," said the Madrid captain, who has 13 goals this season with club and nation. "It doesn't matter who scores the goals, what is important is that we win the matches."
A late goal by Karim Benzema gave the hosts a two-goal advantage ahead of the second leg next week at Girona, which is trying to pull off another Copa upset after eliminating Atletico Madrid in the round of 16.
"It was a good first step but it's not over yet," Ramos said. "We saw what Girona did against Atletico, scoring three times against them as visitors. It's not going to be easy."
Winless in nine straight matches in all competitions, Girona got past Atletico with a 1-1 draw at home and a 3-3 draw in the second leg in Madrid.
"With the two away goals we scored tonight we have realistic chances of reversing this result at home," Girona captain Alex Granell said.
Madrid was eliminated in the Copa quarterfinals the last two seasons. It last made it to the semifinals in 2014, when it won the title.
Girona took the lead with a seventh-minute goal by Honduran striker Anthony Lozano, but Real Madrid regained control after Lucas Vazquez equalized from inside the area in the 18th and Ramos converted a 42nd-minute penalty — Panenka-style, down the middle — after Vinicius Junior was fouled inside the area.
"Don't rule out Ramos playing as a striker if needed," Real Madrid coach Santiago Solari said. "He is a warrior."
Girona came back with a penalty converted by Granell in the 66th after a handball by Madrid midfielder Marcos Llorente, who had entered the match only a few minutes earlier. Ramos came to the rescue again in the 77th, scoring with header into the top corner after a cross by Marcelo for his 102nd career goal.
Benzema added to the lead in the 80th with a touch from close range after a low cross by Vinicius Junior.
Solari didn't rest many of his top players, while Girona was without some key pieces of its squad, including striker Cristhian Stuani.
Madrid midfielder Toni Kroos made his return from injury by replacing Luka Modric in the second half.
On Tuesday, Getafe defeated Valencia 1-0 at home as the quarterfinals got underway. Four-time defending champion Barcelona — without Lionel Messi and other regular starters — lost 2-0 at Sevilla on Wednesday in a rematch of the Copa final both in 2016 and 2018.
Earlier Thursday, Real Betis scored late to draw 1-1 with Espanyol in Barcelona.
Borja Iglesias put the hosts ahead from close range in the 27th minute, and Paraguayan forward Antonio Sanabria evened the match following a quick counterattack in the 81st.
"It was pity to concede that goal in the end," Espanyol coach Joan "Rubi" Ferrer said. "The most difficult part of the game was already behind us."
It was an open match from the start at RCDE Stadium, with both goalkeepers having to make several difficult saves.
Betis had a goal disallowed for offside in the 63rd.
"It was a good result for us, but we could have done even more," Real Betis coach Quique Setien said.