Gareth Bale scored four goals as Real Madrid hit nine-man Rayo Vallecano for double figures in a remarkable game.
Real trailed before Tito’s red card – Danilo putting the hosts ahead before headers from Antonio Amaya and Jozabed.
Bale levelled with a header before Raul Baena was sent off in conceding a penalty which Cristiano Ronaldo scored.
As the game opened up, Bale added three more, Ronaldo scored a second and Karim Benzema netted a hat-trick – including number 10.
Real boss Rafael Benitez has been under pressure after losing three of their last five La Liga games.
But it remains to be seen if the farcical circumstances of their win over neighbours Rayo will ease much of that, as they were playing poorly before the sendings off.
It was the first time they hit double figures in a La Liga match since 1960, when they beat Elche 11-2.
Real remain two points off leaders Barcelona and Atletico Madrid, who both have a game in hand.
Real Madrid’s win will never be forgotten by anyone who watched the game – but remarkably Benitez will still be under pressure.
Whistles were ringing out at the Bernabeu from unhappy home fans at 1-1 – moments before Jozabed put Madrid minnows Rayo into the lead. But the game changed when Tito was deservedly sent off for a dangerous studs-up, two-footed tackle on Toni Kroos.
And after Ronaldo made it 3-2 from the spot against nine men in the 30th minute, double figures always felt as a possibility as Real were able to launch attack after attack with limited options in defence for Rayo.