Real Madrid boss Zinedine Zidane praised the patience of his side after Karim Benzema's stoppage-time winner secured a 2-1 win over Elche and sent them second in LaLiga.
Elche had taken the lead just after the hour when Dani Calvo headed in off the crossbar following a corner.
Los Blancos, though, regrouped and equalised through a close-range header from Benzema in the 73rd minute.
Just when it looked like the hosts would have to settle for a point, French forward Benzema volleyed Rodrygo's lay-off into the bottom corner for his fifth goal in the past four games.
Real move into second spot, a point above Barcelona who face Huesca on Monday, with leaders Atletico Madrid in action at Getafe later on Saturday.
"My thoughts on the match are positive, because that is what it is all about – a comeback," Zidane said afterwards on Real Madrid club media. "We believe in what we are doing and had to work for it.
"We had two or three chances to score before, we didn't do that, but we did have patience we turned it around and it is fair result.
"Both goals were brilliant and came after very good plays and that's an important thing for us."
Captain Sergio Ramos returned to the side following injury and played in a back three with Raphael Varane and Nacho.
Ramos, who had a minor surgical procedure on his knee problem, was replaced just after the hour as Real Madrid switched formation.
"It was an option that we had already used to get further forward with the wing-backs," Zidane added at his post-match press conference:
"When we get into our stride and we keep patient, things happen. We have to believe more, but without going crazy.
"Elche defends well and physically they are very strong. With all the teams closing back, it costs a lot, but this is not going to change.
"We must find the solution against a team that defends well. In the end, we found the hole with patience and rhythm.
"In the end, it was important to score three points and continue in the fight for the league."
Elche boss Fran Escriba feels his side can take heart from their efforts at the Estadio Alfredo Di Stefano as they battle to stay up.
"I have told the players that they have to feel reinforced after this game," Escriba said on Elche club media.