Ousmane Dembele scored the only goal as LaLiga champions Barcelona survived a late VAR scare to claim a hard-fought 1-0 win at promoted Real Valladolid.
Dembele struck just before the hour after spurning several chances at the Estadio Jose Zorrilla but the hosts would not lie down and almost snatched a last-gasp point.
Keko thought he had equalised in added time but his header was eventually ruled out for offside after intervention by the video assistant referee.
It was with much relief that Barca heard the final whistle. The result had maintained their winning start to the season but had proved much tougher than expected.
Such a tight finish seemed unlikely early on as Dembele had his first opportunity with five minutes gone when he missed the target from a tight angle.
Valladolid responded with Enes Unal and Ruben Alcaraz both testing Marc-Andre ter Stegen but Dembele twice went close again after combining with Philippe Coutinho and Jordi Alba.
Coutinho, back in the starting line-up after coming off the bench and scoring against Alaves last week, also teed up a chance for Luis Suarez and forced a save from Jordi Masip. Lionel Messi then fired over from a free-kick.
The dangerous Unal threatened again for Valladolid early in the second half but curled an effort wide before Barca pushed the hosts back again.
Dembele brought two more saves from Masip before finally getting his goal on 57 minutes, lashing home from a Sergi Roberto knock-down. Valladolid protested, feeling Roberto may have been out of play, but the goal was allowed to stand.
Valladolid managed to rouse themselves and Oscar Plano fired wide before Keko wasted a good chance when he headed straight at Ter Stegen from a Duje Cop cross. Kiko Olivas also got in a good position but could not beat Ter Stegen.
Barcelona finished strongly and Suarez had a goal ruled out for offside before substitute Malcom forced a low save from Masip.
Yet Valladolid were not quite done and drama followed deep into stoppage time as Keko headed home what he thought was an equaliser but the referee felt he was offside.
There was an agonising wait as the incident was reviewed but the goal was ruled out and Barcelona limped to victory.