After a test start to the season, goals from Jordi Alba and Frenkie de Jong gave Barcelona a 2-1 victory and reduced some of the pressure on Ronald Koeman ‘s side.
Willian Jose led Socieded, who fell off the top spot after Wednesday’s game, when he hit in a Cristian Portu cross halfway through the first half.
But Barcelona responded quickly as Scotland fired a shot into the top corner before setting up De Jong just before half-time after a VAR inspection.
“The first half was great, we should have scored more goals,” Koeman told reporters after the game, all told Reuters.
“We were intense, we put them under a lot of pressure and ran ourselves into the ground.”
“Real Sociedad are excellent at the ball but we kept attacking them, we put pressure on them as well. It was an open game because our opponents know how to play to good game but we owned the game and it was a well deserved win. “
Visit CNN.com/sport for more news, videos and features
In a night dedicated to Messi, the Argentine won his 300th home victory, which includes 211 in La Liga, 53 in the Champions League, 30 in the Copa del Rey and six in the Supercopa, according to Opta.
Barcelona face Valencia next Saturday, while Sociedad travel to Levante, a side that has gone nearly four weeks without a win.