Real Madrid extended their winless run to four games as Manu Garcia’s late goal secured a shock win for Alaves.
Garcia headed the winner in the fifth minute of added time to clinch Alaves’ first La Liga victory over Real since 1931.
The win moves Alaves joint-top of the table alongside La Liga giants Real and Barcelona.
Julen Lopetegui’s side have now lost three times in four matches without scoring.
While much of the attention will be on Real Madrid, hosts Alaves deserve credit for a battling display that puts them joint top of the table.
They had goalkeeper Fernando Pacheco to thank in the opening stages as he denied Karim Benzema and Dani Ceballos.
But after weathering the Real Madrid storm, Alaves grew into the game and more than matched their illustrious opponents.
The visitors struggled to clear many clear-cut openings after the break and as the game wore on they left themselves vulnerable to the sucker punch.
That proved to be the case as Garcia snatched the winner from close range after Ruben Sobrino’s initial effort was well saved by Thibaut Courtois.
That was pretty much the last kick of the game, with the final whistle sparking scenes of jubilation inside the Mendizorrotza Stadium as Alaves secured a historic victory.