Real Madrid began their La Liga title defence with a hard-fought victory over Almeria, coming from behind to win 2-1.
Largie Ramazani, a former Manchester United striker, put Almeria ahead after just six minutes.
Before Lucaz Vazquez equalised, home goalkeeper Fernando Martinez made a string of saves to frustrate Real.
After coming off the bench, David Alaba scored the game-winning free-kick with his first touch.
Real Madrid began the new La Liga season with confidence after defeating Eintracht Frankfurt in the Uefa Super Cup on Wednesday.
They were stunned, however, when Belgian forward Ramazani beat the offside trap and fired past Thibaut Courtois to put Almeria ahead. Ramazani left Man United in 2020 after coming through their youth ranks.
Real, who had been denied on several occasions by Fernando, thought they had equalised just before the break, but Vazquez's well-taken volley was chalked off for offside.
However, Vazquez scored in the 61st minute after the ball fell kindly to him after a burst of pace from the lively Vinicius Jr.
With 15 minutes remaining, Real Madrid manager Carlo Ancelotti turned to Alaba, who smashed a brilliant left-footed free-kick past Fernando seconds after replacing Ferland Mendy.
Three minutes into added time, Almeria had a chance to equalise when Curro Sanchez's free kick found Rodrigo Ely, but the Brazilian defender headed straight at Courtois.