Cristiano Ronaldo scored a fortunate first goal of the season with his deflected 75th minute free-kick proving the winner in a 2-1 win at promoted Real Sociedad as Real Madrid moved to the top of La Liga for the first time under Jose Mourinho.
Ronaldo saw his free-kick take a huge deflection off team-mate Pepe and loop in 15 minutes from time and the world's most expensive player seemed embarrassed to celebrate the winning goal which handed Mourinho his first away win.
Argentine international winger Angel di Maria - a 25-million-euro summer signing from Benfica - scored a memorable first Real goal on 51 minutes only for veteran Raul Tamudo to equalise as Real conceded their first goal under Mourinho.
However, Ronaldo had the final say with his freak goal and Madrid rode their luck to go top - a point ahead of Atletico Madrid and Valencia who have played one game less.
Despite the win, Mourinho was far from happy throwing his water bottle in the dug-out late on.
"It was great to get my first goal and the points in a tough match against a very good team," said di Maria. "Now we'll see what Atletico (Madrid) do against Barcelona."
Champions Barcelona are four points behind Real and travel to league leaders Atletico on Sunday.
It was Sociedad's first defeat of the season but the league newcomers tested Real to the limit in a sensational atmosphere at the Anoeta stadium and were denied a late equaliser at 2-2 by goalkeeper Iker Casillas.
Mourinho made just one change from the side that convincingly beat Ajax 2-0 at the Santiago Bernabeu in the Champions League on Wednesday with Sergio Ramos replacing Alvaro Arbeloa.
It was a special game for Madrid midfielder Xabi Alonso who began his career at hometown club Sociedad and was part of the Sociedad side that finished league runners-up to Real in 2003.
Real started on the front foot but it was Sociedad who had the best chances with French midfielder Antoine Griezmann guilty of two glaring misses.