The Catalan giants got off to the worst possible start as they fell behind in the 13th minute through a powerful finish from Gorka Elustondo.
Ernesto Valverde's men were left shell-shocked as they struggled to carve out clear-cut chances in the opening 20 minutes of the encounter.
The visitors should have restored parity on after 37 minutes when Gerard Pique placed his header wide of upright following a corner.
Pique thought he could have earned his side a penalty just before the break, but the referee decided against awarding a spot-kick after consultation with the Video Assisant Referee (VAR).
However, Barca were level after 63 minutes as Luis Suarez smashed home from close range after the hosts failed to deal with a corner.
Ousmane Dembele continued his fine form for Barca as he put his side ahead three minutes later with a deflected finish.
Sociedad tried to hit back and they should levelled matters in the 87th minute but Juanmi failed to hit the target after being picked out by Merino.
In the end, the defending champions managed to hold on to claim yet another victory and maintain their winning start.