Karim Benzema's 89th minute strike earned a much changed Real Madrid victory over Huesca to move two points behind city rivals Atletico in La Liga, but Zinedine Zidane's side were far from convincing.
The Bernabeu was stunned into silence after just three minutes when Nacho Fernandez was easily dispossessed by Ezequiel Avila, who found an unmarked Cucho Hernandez in the area to give La Liga's bottom side a shock early lead.
Los Blancos were rattled, but in the 25th minute, a Karim Benzema shot was only parried to former Manchester City forward Brahim Diaz, who laid off Isco to level for Madrid with his second goal in two games.
Huesca's end product let them down badly, and they were punished when Madrid took the lead in the 62nd minute, after Benzema nodded down a brilliant Gareth Bale cross to give Dani Ceballos the simple task of tapping in from three yards out.
Zidane's side were then caught out by a short corner, and Xabier Etxeita headed home from Moi Gomez's cross to equalise for Huesca. Benzema broke the visitors' hearts in the final couple of minutes with a fine curling effort on the edge of the area to give Los Blancos an undeserved win.
Key Talking Point
This was only Zidane's second match in charge since his return as manager, and the Frenchman played a weakened team against a side who were making their first ever appearance at the Bernabeu
With no Courtois, Modric, Kroos, Varane or Asensio in the starting XI, this was a big opportunity for some Madrid squad players to make their case to be first team regulars.
But they did not take advantage of that opportunity in the first half, as Madrid very much looked like a side who have never even trained together, let alone played a match with each other. Their defending was timid at best, and Huesca were unfortunate not to be ahead at the interval.
The reigning European champions didn't look much better in the second half, and seemed extremely vulnerable to any kind of counter-attack or lofted through-ball. Had Madrid faced better opposition with a much better end product, they would have been soundly beaten.
Zidane will use these last few games of the season to see who is worthy of wearing that infamous white shirt, and on this evidence, that reported £300m Madrid have to spend this summer can't come soon enough.
Starting XI: Zidane (5); Odriozola (7), Nacho (4), Ramos (5), Marcelo (5); Isco (6), Llorente (7), Ceballos (6); Bale (5), Benzema (7), Diaz (6).
Substitutes: Vazquez (6), Valverde (6), M Diaz (5).
Star Man - Karim Benzema
Slim pickings for this category after a poor display from Los Blancos, but if anyone can come away from this match who can be pleased with his personal performance, it's the 31-year-old French forward.
Benzema drifted all over the pitch to help his side gain some sort of control and unlock a determined five-man defence that Huesca had put out to stop Zidane's side.
He was heavily involved in the first goal, grabbed an assist for the second and scored an impressive late winner to cap off a fine individual performance, which involved plenty of hard work and clever movement.
Real Madrid will look to continue to eat away at Atletico Madrid's lead over them when they travel to the Mestalla Stadium to face Valencia on Wednesday, before hosting mid-table side Eibar on 6 April.
Huesca face a huge clash against relegation rivals Celta Vigo on Wednesday at home, with a trip to Levante for La Liga's basement club coming up next Sunday.