Match ends, Real Sociedad 1, Real Madrid 3.
Gareth Bale scored a superb goal as Real Madrid ended Real Sociedad's 100% winning start to the season in La Liga.
The Welshman had been poor up until his strike when he outpaced Kevin Rodrigues before dinking a finish into the net.
Striker Borja Mayoral netted the opener for Real Madrid, tucking in his first goal for the club from close range.
Home full-back Rodrigues had gone from hero to villain, volleying home an equaliser which squirmed under Keylor Navas, before scoring an own goal.
The match was held up for several minutes following the home side's equaliser, as a television cameraman received treatment and was taken away on a medical cart with his leg in a brace.
He appeared to be injured as the crowd around him, in a temporary stand, celebrated the goal.
Zinedine Zidane's side remain unbeaten this season with two wins and two draws, moving up to fourth in the table, four points behind leaders Barcelona.
Bale loves the Anoeta
Champions Real had drawn their previous two league games going into the fixture. They required two goals from Marco Asensio to escape with a point against Valencia, before being held 1-1 by a stubborn Levante.
In that match, winger Bale cost his side by missing a host of chances, but the former Tottenham man made amends at the Anoeta by netting his sixth career goal at the venue.
There looked to be little danger when Isco pumped a long ball into the final third, as Rodrigues had a five-yard head start on his opponent, but Bale showed his pace to collect the ball and his composure to finish.
Youth product Mayoral, in for the injured Karim Benzema, did his first-team prospects no harm by getting on the scoresheet for the first time, but Ballon d'Or winner Cristiano Ronaldo should return to the side for the next game after completing his five-game suspension.
Elsewhere in La Liga...
Villarreal inflicted a 3-0 home defeat on Alaves, leaving them bottom of the table and without a win in their first four games. After the match, Alaves announced the sacking of head coach Luis Zubeldia because of "the results obtained in the beginning of the season".
Former Chelsea striker Loic Remy scored the winning goal three minutes from time as Las Palmas edged past Athletic Bilbao 1-0.
Sevilla moved up to second as Luis Muriel scored the only goal in the victory over newly promoted Girona.
- 3LlorenteBooked at 36mins
- 10Prieto ArgarateSubstituted forJuanmiat 69'minutes
- 4IllarramendiBooked at 42mins
- 16CanalesSubstituted forVelaat 57'minutes
- 12Da Silva
- 8JanuzajBooked at 45minsSubstituted forAgirretxeat 77'minutes
- 13Ramírez Martínez
- 24de la Bella
- 15HernándezSubstituted forNachoat 90+3'minutes
- 14CasemiroBooked at 64mins
- 21MayoralSubstituted forVázquezat 75'minutes
- 20AsensioBooked at 38minsSubstituted forCeballosat 86'minutes
- 29Feuillasier Abalo
- Ignacio Iglesias Villanueva
- Shots on Target
Second Half ends, Real Sociedad 1, Real Madrid 3.
Gerónimo Rulli (Real Sociedad) wins a free kick in the defensive half.
Foul by Sergio Ramos (Real Madrid).
Attempt blocked. Isco (Real Madrid) right footed shot from the centre of the box is blocked. Assisted by Gareth Bale.
Foul by Imanol Agirretxe (Real Sociedad).
Casemiro (Real Madrid) wins a free kick in the defensive half.
Substitution, Real Madrid. Nacho replaces Theo Hernández because of an injury.
Attempt missed. Carlos Vela (Real Sociedad) right footed shot from outside the box is close, but misses the top right corner. Assisted by Asier Illarramendi.
Delay over. They are ready to continue.
Delay in match Kévin Rodrigues (Real Sociedad) because of an injury.
Delay in match Theo Hernández (Real Madrid) because of an injury.
Kévin Rodrigues (Real Sociedad) wins a free kick in the defensive half.
Foul by Daniel Carvajal (Real Madrid).
Carlos Vela (Real Sociedad) wins a free kick on the right wing.
Foul by Theo Hernández (Real Madrid).
Foul by David Zurutuza (Real Sociedad).
Casemiro (Real Madrid) wins a free kick on the right wing.
Substitution, Real Madrid. Dani Ceballos replaces Marco Asensio.
Offside, Real Madrid. Casemiro tries a through ball, but Gareth Bale is caught offside.