Karim Benzema curled in a late winner as Real Madrid won for the second time in as many matches since Zinedine Zidane returned as manager, beating Huesca 3-2 at the Santiago Bernabeu on Sunday.
Isco and Dani Ceballos scored after Watford loanee Juan Camilo Hernandez had given bottom-of-the-table Huesca a shock third-minute lead. The visitors drew level when skipper Xabier Etxeita headed in 16 minutes from time, before Benzema had the final say.
Real have now closed to within two points on second-place Atletico Madrid but remain 12 adrift of La Liga leaders Barcelona.