Second-half goals from Isco and Lucas Vazquez spared Real Madrid's blushes as they were pushed all the way by a spirited Osasuna side before securing a 3-1 La Liga win on Saturday.
Zinedine Zidane's men found themselves under a little pressure after Barcelona's 6-0 obliteration of Alaves put the Catalans temporarily top, but Madrid - who still have two games in hand - did just about enough at El Sadar despite at times looking less sharp in attack than their rock-bottom hosts.
The first half was overshadowed by Osasuna right-back Tano fracturing the tibia and fibula of his right leg in a collision with Isco, and Madrid capitalised on the hosts' subsequent shock by taking the lead through Cristiano Ronaldo.
But Osasuna's response was magnificent, as they became a threat with their pace in attack and showed no evidence of being bottom of the table, deservedly levelling through a lovely Sergio Leon effort.
Osasuna continued to look dangerous going forward and they caused Madrid problems early in the second half, but their inability to regularly test Keylor Navas after the break was exploited by Madrid - Isco finding the net with a clinical finish in the 62nd minute.
A cool finish from substitute Vazquez deep into stoppage time added perhaps undeserved gloss to the scoreline but Madrid will care little as they restored their one-point lead over Barca to take them into Wednesday's home Champions League clash with Napoli in winning form.
Osasuna began in positive fashion, seeing plenty of the ball and looking a threat out wide with Jaime Romero and Alex Berenguer during the early exchanges.
But in the 15th minute, right-back Tano was taken off on a stretcher after suffering a horror injury in a collision with Isco.
Players on both sides looked visibly shaken by the Dominican's situation and the tempo of proceedings was certainly impacted.
But Madrid adjusted better and took the lead 24 minutes in – Ronaldo racing on to Karim Benzema's throughball and rifling past the hapless Salvatore Sirigu.
Osasuna rallied, though, and hauled themselves level in rather simple fashion, as Leon raced on to a hopeful lofted pass over the Madrid defence and lifted a delicate finish over Navas.
Benzema should have restored Madrid's lead shortly afterwards, meeting Ronaldo's low ball from the right only for Sirigu to launch himself in front of his shot to make amends for conceding the opener.
Osasuna looked similarly positive going forward at the start of the second half and almost went ahead just after the break – Leon cutting inside from the right and forcing Navas into a smart save at full stretch to tip the curling effort around the post.
Madrid were then forced into a change when David Garcia caught Danilo's ankle with a nasty lunge just before the hour mark.
Though it did not appear to hinder the visitors, as they went ahead again a few moments later – Isco pouncing on a loose ball in the area before applying a composed finish into the bottom-left corner.
Madrid should have been given the chance to finish Osasuna off 12 minutes from the end when Garcia appeared to impede Ronaldo, but referee Ignacio Villanueva dismissed his protestations.
The away side were not made to rue that decision, though, as Vazquez wrapped things up right at the end, latching on to a pass into the right side of the area before clipping a fine finish over the advancing Sirigu.