Luis Suarez and Ousmane Dembele scored as Barcelona came from behind to beat Real Sociedad 2-1 in La Liga on Saturday.
Artiz Elustondo opened the scoring in the 12th minute and Barca might easily have dropped points had their opponents been more clinical.
Mikel Oyarzabal and Theo Hernandez both could have made it 2-0 after half-time but the former blazed over and the latter was denied by Barca keeper Marc-Andre ter Stegen.
Within minutes, the hosts were behind, as two crosses caused havoc in Real Sociedad's defence, with Suarez and Dembele perfectly placed to pounce.
Barca coach Ernesto Valverde had made the surprise decision to omit Sergio Busquets from his starting line-up, presumably with Tuesday's Champions League opener against PSV Eindhoven in mind.
But it was testament to the hosts' performance that Busquets was called upon in the second period after Philippe Coutinho had also been introduced at half-time.
"In the first half they closed us down well but Philippe coming on in the second half helped changed the dynamics," said Suarez.
"These are the kinds of matches that decide La Liga Last year we turned around a two-goal deficit [for a 4-2 win] here and today we showed the importance of fighting back to gain confidence and win here again."
Defending champions Barcelona have won their first four matches of the season.