Karim Benzema struck twice as Real Madrid came from behind to win 2-1 against Eibar at the Bernabeu.
Eibar took the lead in the first half through Marc Cardona, who struck with the first shot on target of the match in the 39th minute.
Benzema had two efforts ruled offside before he headed home twice in the second half, in almost identical fashion, in the 59th and 81st minutes to give his side the lead.
Gareth Bale had an early chance to take the lead in a one-on-one with the Eibar goalkeeper but was unable to get the shot away, and his effort was accompanied by whistles from the Real Madrid fans.
Madrid had the ball in the net but Benzema’s effort was ruled out for offside after a pass from Bale.
Bale was caught offside three times in the opening 15 minutes and further whistles ensued after the Welshman fired a long-range shot well wide of the target.
Eibar took the lead through Cardona, following a pass from Gonzalo Escalante. The Barcelona loanee waited for goalkeeper Keylor Navas to make his dive before clipping it over him into the net.
The home side were accompanied off by whistles at half-time by the Bernabeu faithful.
Luka Modric forced goalkeeper Marko Dmitrovic into his first save of the game just after the half time break from a long-range shot.
Benzema found the net for a second time after the goalkeeper kicked the ball off a defender and it fell to the French forward, who tapped the ball into the empty net, only to have his attempt ruled out again for offside after a VAR review.
Moments later Benzema found the equaliser, heading home a Marco Asensio cross for his 16th league goal of the season.
With less than 10 minutes left Benzema handed Madrid the lead with another header, but this time the cross was supplied by Toni Kroos.
The Frenchman had two late chances to complete his hat-trick, missing an almost empty goal after substitute Lucas Vazquez squared the ball for Benzema rather than taking the shot himself.
The second came a few minutes later when his curled effort struck the post but Madrid picked up the victory which leaves them third, 10 points behind LaLiga leaders Barcelona.