Real Madrid's unbeaten league start was ended as they were stunned 1-0 by promoted Real Mallorca.
Barcelona's 3-0 win at Eibar earlier in the day had relegated Real to second place, and Zinedine Zidane's side failed to reclaim top spot as Lago Junior's seventh-minute strike proved decisive.
Real's misery was completed 17 minutes from time when right-back Alvaro Odriozola was sent off for a second bookable offence.
Odriozola had been walking a tightrope from the 19th minute, and he slipped off it when he foolishly challenged Lago Junior and left Real one man short.
Mallorca had to defend for long periods, especially in the second half as a white-shirted wave came towards them, but Real lacked a cutting edge and rarely tested home goalkeeper Manolo Reina.
It was Mallorca's best win since their promotion from the Segunda Division and moved them out of the relegation spots and into 14th place.
Real were without injured trio Gareth Bale, Luka Modric and Toni Kroos, and summer signing Eden Hazard was also missing after his wife had given birth.
So Luka Jovic made his first league start in nearly a month to join Karim Benzema in attack. Isco tested Mallorca goalkeeper Reina with an early effort but Real were soon behind.
Odriozola allowed Lago Junior to cut inside him onto his right foot and curl a splendid shot past Thibaut Courtois - his first La Liga goal coming two seasons after he was playing in the third tier for Malaga.
Mallorca thought they had doubled their lead after 14 minutes when Ante Budimir drove home but the assistant referee had correctly flagged for offside.
Real dominated as the half wore on with Benzema striking the crossbar from close range and Reina holding Marcelo's powerful 20-yard shot.
Mallorca sent on full-back Lumor Agbenyenu for the second half and he tried his luck from distance within 30 seconds, his rising shot just clearing Courtois' crossbar.
But the pattern of the first half was soon re-established as Real set up camp in Mallorca territory.
Reina held Benzema's deflected strike and Sergio Ramos sent a 25-yard free-kick over the bar.
However, Real often lacked composure around the edge of the penalty area as Mallorca got bodies around the ball.
Real were still struggling to create clear-cut chances when Odriozola dived in to stop Lago Junior to receive his second yellow card.
Reina had to collect Eder Militao's header when James Rodriguez floated a free kick into a crowded penalty area.
But, in truth, Mallorca saw out the closing stages in comfort and well worth their unlikely victory.
Elsewhere in La Liga
Atletico Madrid remain fourth, three points behind Barcelona and one adrift of surprise package Granada after drawing 1-1 at home against Valencia.
Diego Costa's first-half penalty, after the video assistant referee adjudged Valencia midfielder Denis Cheryshev to have handled, was cancelled out by Daniel Parejo's brilliant late free kick.
Valencia's South Korea midfielder Lee Kang-in was sent off in stoppage time after his yellow card, for his challenge on Carlos Soler, was upgraded to a red by VAR.
Getafe registered their third straight win in all competitions thanks to forward Angel Rodriguez's second-half double in a 2-0 home victory against Leganes.