Rayo Vallecano became the first side to beat Real Madrid in La Liga this season, completing a 3-2 upset over the defending champions at home.
Oscar Trejo scored the winning penalty in the second half after Santiago Comesana and Alvaro Garcia had scored for the hosts while Luka Modric and Eder Militao had found the net for the visitors in the first half.
With the World Cup on the horizon, Carlo Ancelloti decided to rest Ballon d’Or winner Karim Benzema once again in a game that turned out to be feistier than anticipated.
Comesana opened the scoring in just the fifth minute beating Thibaut Courtois with a volley before the Belgian denied Isi Palazon whose shot from distance was heading for the back of the net.
The first half then ended in a flurry of goals first when Luka Modric drew his side level from the penalty spot after Marco Asencio was fouled before Militao put his side ahead by heading in a corner in the 41st minute.
The home side still had time to find their equaliser before the break when the ball fell kindly to Alvaro Garcia in the box and he managed to beat Courtois with another volley.
Dani Carvajal then committed the foul which led to Vallecano being awarded a penalty that Courtois saved but before the defender was found guilty of encroachment leading to a retake which Trejo did not miss a second time.
With time running out Real Madrid made a late push to salvage a point but Rayo Vallecano stood firm dishing out the first loss of the season to the visitors.
Madrid slips to number two on the league table with 32 points behind now-leaders Barcelona who defeated Almeria earlier on the weekend.