A brilliant header was enough for Athletic Bilbao to sink Madrid, leaving Barcelona the chance to go top of La Liga.
Real Madrid left the door open for Barcelona to go top of La Liga as Athletic Bilbao capped a superb week with a surprise 1-0 victory over the capital club.
Fresh from beating Espanyol on Wednesday to reach the Copa del Rey final, Ernesto Valverde's men picked up three points in Saturday's clash at San Mames thanks to Aritz Aduriz's first-half header.
For Real, which thumped Bilbao 5-0 in October's reverse fixture, it marks another disappointing showing after the club was held to a 1-1 draw at home to Villarreal last weekend.
Head coach Carlo Ancelotti demanded a response to that performance in his pre-match news conference, but Real failed to heed his call and a lackluster first-half display saw the side go in behind.
The European champion improved after the interval and only some excellent Bilbao defending prevented Karim Benzema and Cristiano Ronaldo from scoring simple tap ins, while Gareth Bale nearly grabbed a fortuitous leveller late on.
Ultimately, though, Real failed to find an equalizing goal and will slip to second if Barcelona beats Rayo Vallecano on Sunday.
Bilbao's first win over Real since Jan. 2010 means the club moves up to eighth.
Aduriz flashed a shot wide of the left-hand post in just the second minute, but Bilbao found itself chasing the ball for much of the opening quarter.
For all the visiting side's possession, clear-cut chances proved few and far between, although Xabier Etxeita made a potentially crucial interception to stop Benzema's center picking out the unmarked Ronaldo, while Pepe headed over from the resulting corner.
Real's failure to break down Bilbao's stubborn defense was punished in the 26th minute.
Mikel Rico hung up an excellent cross between the Real center backs and Aduriz timed his run perfectly to meet the delivery with a thumping header that nestled in the right-hand corner.
Real had failed to register a shot on target by halftime, but the break seemed to do Ancelotti's men good.
Only an excellent interception from Mikel Balenziaga prevented Benzema from tapping in Ronaldo's cross, while the Portuguese seemed set to add the finishing touch to a Bale ball across the six-yard box before goalkeeper Gorka Iraizoz palmed away from danger.
Iraizoz was called into action again in the 74th minute, racing off his line to prevent Ronaldo from sliding home.
At the other end Bilbao almost stole a second when Dani Carvajal's attempted defensive header set up Aduriz, whose header hit the outside of the left-hand post.
As the clock wound down Real came desperately close to making it 1-1 when an apparent cross from Bale, delivered from just in front of the halfway line, sailed over Iraizoz and rebounded off the right-hand post.
The equalizer proved elusive, however, as Real slipped to a fifth Liga defeat of the season.