Casemiro's stunning long-range strike and a late goal from Luka Modric earned Real Madrid a 2-0 win over Sevilla on Saturday and a much-needed boost to their flailing title challenge in La Liga.
Madrid began the day 10 points adrift of leaders Barcelona, a gap that will be restored if the Catalans defeat Leganes on Sunday, but this victory should inject a timely shot of confidence.
Casemiro's bending effort in the 78th minute and Modric's injury-time finish settled a compelling contest of third against fourth but Madrid were dominant in the second half and, in the end, deserved the points.
It means they move above Sevilla and behind Atletico Madrid, who stay second after running out 3-0 winners away at bottom-club Huesca.
Diego Simeone's side remain Barca's most tenacious challengers but for Real, this was their most impressive result in weeks, following a run of only two wins from five matches.
"Beating your direct rivals is always worth more than three points," coach Santiago Solari said afterwards. "The celebration for our first goal was pure joy."
Madrid had been thrashed by Sevilla in September, a 3-0 loss that triggered a run of one victory in seven games, the seventh culminating in Julen Lopetegui being sacked.
Solari sparked a brief revival but performances had slumped again. This was more like it, a purposeful display led by Modric, who played first with a bandage and then stitches to protect a cut eye.
"He was outstanding," Solari said. "Considering he played with a cut, and stitches, he is a fighter. The fact he scored in the last minute shows his spirit and the spirit of the team."
Sevilla had gone top in November when Barca were also stuttering but doubts remain about their sturdiness under pressure. In their last 28 visits to the Santiago Bernabeu and Camp Nou, they have now lost 27 and drawn one.
"The biggest games hit you not only physically but mentally too," Sevilla coach Pablo Machin said. "I have always said there would be moments this season where we were not playing so well."
Isco, Marcelo left out
Isco again started on the bench, along with the struggling Marcelo, while Gareth Bale was absent as he continues to recover from a calf strain.
Vinicius Junior was Madrid's brightest spark in the first half and could have scored early after Modric robbed Ever Banega in midfield but the teenager's shot was saved easily by Tomas Vaclik.
Sevilla grew in confidence and had the best chance before the interval as one pass sent Wissam Ben Yedder racing clear on the counter-attack.
Madrid's defenders sprawled to track the runners but Sergio Escudero arrived late on the left and only had Thibaut Courtois to beat. He drilled into the side-netting.
Modric's head was bandaged after a collision with Franco Vazquez while his team were much improved in the second half.
Vinicius' shot was blocked, Modric curled over and Dani Carvajal weaved through. Dani Ceballos' bending effort even rattled the crossbar, with Vaclik tapping it afterwards in gratitude.
Isco came on with 14 minutes left and shortly after Madrid finally found the breakthrough. Casemiro collected the ball 25 yards out, looked up and sent it soaring towards the left-hand corner. Vaclik dived but a weak right hand could only help it in.
Sevilla, pegged back for so long, never looked like switching the momentum and Modric wrapped up the win in injury time.
Daniel Carrico was at fault, caught in possession by the Croatian, who finished like a striker before wheeling away, roaring to the home fans in relief.
Atletico's victory over Huesca, who are now 10 points adrift of safety, was never in doubt.
Santiago Arias' volley was the pick of the goals at a foggy Alcoraz Stadium, as he drove in Antoine Griezmann's cross to the back post. Lucas Hernandez and Koke made sure of a comfortable win.