Frenchman Ousmane Dembele scored the winning goal for Barcelona in the 66th minute as the champions maintain their flawless start of the season winning the match 2-1.
Real Sociedad scored the first goal of the match in the 12th minute through Aritz Elustondo who was brilliantly assisted by Hector Moreno.
But Luis Suarez scrambled the ball home in the 63rd minute before Ousmane Dembele converted at another corner.
The fightback follows Barca's 4-2 win at Anoeta last January and makes them the only team to still have a flawless record in Spain's top flight, where they lead the standings with 12 points, two clear of Real.
Visiting coach Ernesto Valverde chose to start his side's arguably least favourite away trip without Philippe Coutinho and Sergio Busquets ahead of a jammed schedule of six games in 20 days.
However, Barca were level after 63 minutes as Luis Suarez smashed home from close range after the hosts failed to deal with a corner.
Barely a minute after Ter Stegen had blocked a gaping chance for Juanmi, Uruguayan striker Suarez took advantage of some confusion in the area following a free kick and smashed home from close range to the disbelief of the home supporters.
La Real could have been further in front but missed three chances shortly before the Barcelona goals.
Barcelona were poor in the first half and also capitalised on goalkeeping errors for both goals with Geronimo Rulli missing punches at both set pieces.
Iker Muniain gave Athletic a deserved lead in the 32nd minute by bundling the ball home after Real failed to get back in time to defend a counter-attack.
The visitors finally beat the youngster when Isco nodded home a cross from Gareth Bale in the 63rd minute as the visitors improved after bringing on midfield anchor Casemiro at the start of the second half.
Earlier in the day, Atletico Madrid needed an injury-time debut goal from Borja Garces to draw 1-1 with Eibar.