Real Madrid captain Sergio Ramos produced more late drama by powering home a stoppage-time winner to beat Deportivo la Coruna 3-2 as the European champions set a new club record of 35 games unbeaten in all competitions.
Two goals in two minutes from Joselu just after the hour mark looked set to end Real's unbeaten streak stretching back to April after Alvaro Morata's opener.
However, even without the rested Cristiano Ronaldo, Real maintained their six-point lead at the top of La Liga as Mariano Diaz equalised six minutes from time before Ramos's late intervention.
"When you fight to the end, these things happen," said Ramos, who also netted a last minute equaliser against Barcelona last weekend.
"It wasn't a great performance. We made mistakes which were costly, but at the end we managed to turn it around."
Zinedine Zidane's men have now surpassed Real's previous record mark of 34 games unbeaten from the 1988/89 season under Dutch coach Leo Beenhakker.
"Mentally it helps to have gone 35 games unbeaten. It gives you strength," said Zidane.
"Sergio is special because it is not the first time.
"He is our captain and with many others he is the soul of this team."
Zidane made a host of changes ahead of Real's trip to Japan for the Club World Cup in the week ahead with Ronaldo left out of the squad alongside Karim Benzema and Luka Modric.
The European champions were exceptionally lucky not to be behind at the break as Celso Borges headed against the post and the rebound somehow escaped Guilherme with the goal gaping.
Madrid looked to be on track for the three points early in the second half when Morata turned 25 yards from goal and arrowed a drive into the far corner.
However, the game was turned on its head in a two-minute spell as on-loan Stoke City forward Joselu - formerly of Madrid - struck his first two Deportivo goals.
Madrid were incensed that the referee didn't blow for a foul on Casemiro in the build-up to the equaliser before Carles Gil teed up Joselu to smash the ball in off the underside of the bar.
Real were still rocking from that blow when they were caught cold by another Deportivo counter-attack and this time Joselu drilled the ball between the legs of Keylor Navas.
High up in the VIP boxes of the Bernabeu, Ronaldo cut an increasingly frustrated figure at not being able to ride to the rescue of his team-mates.
In his absence, Mariano was handed a rare first-team opportunity off the bench and took his chance to shine with a looping header from Lucas Vazquez's cross that left Przemyslaw Tyton helpless.
The Polish goalkeeper then suffered an injury when colliding with the post as he made a save in stoppage time.
And Tyton had only just got back to his feet when Ramos powered another header into the net from Toni Kroos's corner.