Rayo Vallecano were left celebrating their first Liga victory over Real Madrid in more than two decades as they inflicted more pain on Zinedine Zidane's misfiring charges.
A penalty from Adrian Embarba in the first half proved the difference between the two Madrid sides in a 1-0 victory vital to Rayo's hopes of staying in the Spanish top flight.
Sunday's three points saw them move off the bottom of the table at Huesca's expense, although Girona's win leaves them six point short of survival with just three games remaining of the 2018-19 season.