Ronaldo fires Real Madrid top of table
Madrid rode their luck on occasion against a fired-up Sociedad side in the first half before taking a 51st-minute lead through Angel Di Maria's superb strike.
That advantage lasted just 11 minutes though before veteran striker Raul Tamudo brought Sociedad back on level terms - the first goal Madrid have conceded in four competitive games under new coach Jose Mourinho.
Madrid were not to be denied their first away win of the campaign though and they took the spoils thanks to a huge slice of luck in the 74th minute.
Cristiano Ronaldo, looking for his first goal of the season, fired in a 25-yard free-kick that took a big deflection off team-mate Pepe standing in the wall and Sociedad goalkeeper Claudio Bravo could only stand and watch as the ball ballooned past him and into the far top corner of the net.