Gareth Bale ended his longest La Liga goal drought by scoring the winner as Real Madrid clinched a fourth successive victory with a 1-0 win over rock-bottom Huesca.
The Wales international scored his first league goal in 802 minutes of football to give Santiago Solari's men the lead at El Alcoraz and they withstood some nervous moments to emerge with all three points.
La Liga debutants Huesca went into the game without a victory since the opening day of the season but they restricted the European champions to a season-low of two first-half shots.
Bale, who shook off a knock in time to start the match, looked dangerous throughout and could have added to his tally, but Solari will have been frustrated by the ease with which Huesca might have equalised had their finishing been less wayward.
Bale's poor league form had drawn criticism before the game but he calmly stroked Madrid into the lead after eight minutes, meeting Alvaro Odriozola's cross with a side-footed volley from 12 yards out that found the corner of the net.
Huesca almost equalised when Ezequiel Avila's thunderbolt of a shot from just inside the box was saved by Thibaut Courtois, but settled for a one-goal deficit at half-time having weathered numerous Madrid attacks.
Substitute Gonzalo Melero headed wide from point-blank range in the opening seconds of the first half, and team-mate David Ferreiro had a dipping drive from the edge of the box tipped over the crossbar by Courtois.
Bale surged down the left flank moments later and forced Aleksandar Jovanovic into a sprawling save, the former Tottenham Hotspur man not punished for then dinking narrowly wide when one-on-one with the goalkeeper as his first-half strike proved sufficient.
What does it mean? Solari's men win ugly
They say that good teams win without playing well and that was certainly the case for Madrid on this occasion. Solari will hope their results can be matched by better football in the coming games.
Bale back in the habit
Much was expected of Bale this season after Cristiano Ronaldo's move to Juventus and he has rarely provided his team with the focal point they have been lacking. However, he did so here and could have had a hat-trick.
Quiet game for the world's best
Luka Modric played his first match since winning the coveted Ballon d'Or trophy but he was short of his best as Huesca competed in midfield and enjoyed more possession and chances than they might have expected.
Real Madrid entertain CSKA Moscow in their final UEFA Champions League group stage match of the season before hosting Rayo Vallecano, while Huesca will aim to avoid a third successive La Liga defeat when they meet Villarreal at home.