Real Sociedad went into the game with a 100% record form their three matches so far but given their dismal record against Madrid at the Anoeta, getting anything from the game was always going to be a tough ask.
Real dominated possession early on without really creating anything of note.
Theo Hernandez wanted a penalty after 13 minutes when he went down under the challenge of former Madrid pair Sergio Canales and Asier Illarramendi but referee Iglesias Villanueva was unmoved.
Theo was in the thick of things in the first half and he drove forward just minutes later before finding Marco Asensio with a low cross but his effort was blocked away.
Willian Jose saw a tame strike from range saved by Keylor Navas before Madrid took the lead.
Youngster Borja Mayoral was the man to make the breakthrough. Theo crossed from the left and as Sergio Ramos look to tee himself up for an overhead kick he was hauled down from behind, allowing the alert Mayoral to pounce on the loose ball volleying home low from eight yards to make it Real’s 73rd straight game in which they have found the net, equalling the record set by Pele’s Santos. Madrid last drew a blank in April 2016 when Manchester City kept a clean sheet in the Champions League semi-final.
Illarramendi almost put Canales in with a beautiful through ball before Sociedad equalised from nowhere.
At this point, the Kevin Rodrigues show began.
Odriozola’s cross from the right found Rodrigues unmarked at the far post and his low volley squirmed through the hands of Keylor Navas and into the far corner.
Geronimo Rulli had to be alert to keep out a header from Casemiro after more good work down the left from Theo just after the half-hour mark but the sides weren't level for long.
Rodrigues almost scored his second of the night only to see his header come back off the bar with Navas beaten.
Madrid countered and the impressive Mayoral shrugged off Llorente on halfway and raced away, he skipped past his man on the edge of the box before firing a low cross across goal which the backtracking Rodrigues could only slide past Rulli at the near post.
The visitors took control as the first half drew to a close with Asensio seeing a long-range effort drop just wide before Modric forced Rulli into a diving stop away to his left with another strike from range.
Zinedine Zidane's went into the break ahead.
Sociedad came out for the second half looking motivated and keen to go down swinging.
Xabi Prieto thought that he should have had a penalty just after the break as he went down under the challenge of Theo at the far post, but the referee was unmoved.
Llorente then headed a corner from the left straight at Navas under very little pressure as the hosts ramped up the pressure.
However, there were still warning signs from Zinedine Zidane’s side. Borja Mayoral went close when his low effort from just inside the box was parried by Rulli. Mayoral latched onto the rebound be he could only smash the loose ball into the side netting.
The threat from Madrid had been minimal in the second half but the visitors gave a lesson in how to change a game in one pass just after the hour mark.
A Sociedad move broke down and Isco immediately sent a long through ball over the top for Gareth Bale to latch onto.
The Welshman raced away from Rodrigues and lured Rulli off his line before dinking the ball over Rulli and into the far corner to become the most prolific away player at the Anoeta in LA Liga history.
The game was over as a contest at this point but the hosts never stopped working. Illarramendi smashed a volley wide after a corner was cleared to him just outside the Real box before Isco saw an effort from range fly just over Rulli’s crossbar.
Bale looked set to bag his second of the night when Asensio crossed low from the left but excellent defending from Llorente denied the former Spurs man a tap-in.
Rulli had to be alert to deny Vazquez after a beautiful piece of play from Isco before Willian Jose guided a tame effort at Navas after good work down the left from Vela.
Asensio almost added gloss to the scoreline late on but his strike was disallowed due the interference from the offside Bale.
Carvajal made a fine tackle to deny Zuruzuta from giving Sociedad a lifeline after he exchanged passes with Willian Jose but Sociedad's efforts were in vain as Real Madrid ran out 3-1 winners.
The win moves Madrid into 4th, four points behind arch-rivals Barcelona who currently top the table, whilst Sociedad remain third despite losing their 100% record.
Next up for Real Madrid is a game against Real Betis at the Bernabeu on Wednesday, whilst Sociedad will make the trip to Levante the following day.