Real Madrid opened their La Liga title defence with a hard-fought victory as they came from a goal down to beat Almeria.
Former Manchester United striker Largie Ramazani fired Almeria into a shock lead after just six minutes.
Home goalkeeper Fernando Martinez made a series of saves to frustrate Real before Lucaz Vazquez levelled.
David Alaba struck the winner from a free-kick with his first touch after coming off the bench.
Having beaten Eintracht Frankfurt in Wednesday’s Uefa Super Cup, Real came into the new La Liga season in confident mood.
But they were left stunned when Belgian forward Ramazani, who left United in 2020 after coming through their youth ranks, beat the offside trap and fired past Thibaut Courtois to put Almeria ahead.
Thwarted by Fernando on several occasions, Real thought they had levelled just before the break, but Vazquez’s well-taken volley was chalked off for offside.
Vazquez got his goal, however, in the 61st minute when the ball fell kindly to him after a burst of pace from the lively Vinicius Jr.
With 15 minutes remaining, Real boss Carlo Ancelotti turned to Alaba and the former Bayern Munich player smashed a brilliant left-footed free-kick past Fernando within seconds of replacing Ferland Mendy.
Almeria had the chance to equalise three minutes into added time when Curro Sanchez’s free-kick found Rodrigo Ely, but the Brazilian defender headed straight at Courtois.