Robert Lewandowski shrugged off a string of missed opportunities to earn Barcelona a 2-1 win over Athletic Bilbao on Saturday in La Liga.
The 36-year-old striker twice hit the woodwork, among other wasted chances, but kept his cool to slot home a 75th-minute winner for the Catalan giants.
Teenage starlet Lamine Yamal put Barcelona ahead with a deflected effort but Oihan Sancet pulled Athletic level from the penalty spot before half-time.
Lewandowski's strike earned Barcelona their second win from two league matches under new coach Hansi Flick.
The former Germany and Bayern Munich boss had hoped to utilise new arrival Dani Olmo but with Barcelona unable to register him because of their financial difficulties, the former RB Leipzig playmaker could only watch from the stands.
Pedri started in midfield after injury, along with 17-year-old Spain star Yamal, who shared a joke with his compatriot Nico Williams, a Barcelona target this summer.
The winger is set to stay with Athletic this season and some Barcelona fans whistled him during his engaging battle with Jules Kounde.
Barcelona drew first blood, with Yamal's effort from the edge of the box deflecting home off Inigo Lekue's head.
Williams whipped a dangerous cross inches wide of the far post at the other end as Athletic threatened.
Barca striker Lewandowski, who netted twice at Valencia in their La Liga opener, struck the post after more good work by Yamal and Raphinha.
Athletic pulled level shortly before the break when young centre-back Pau Cubarsi clumsily fouled Alejandro Berenguer in the area.
Sancet sent Marc-Andre ter Stegen the wrong way from the penalty spot to send the teams in tied at the break.
Polish veteran Lewandowski hit the woodwork a second time, heading Raphinha's free-kick against the far post from point-blank range.
The Brazilian teed up the forward again with an inviting cross but Athletic goalkeeper Alex Padilla made a superb save.
Barcelona were turning the screw and got their reward when Lewandowski fired home his third goal of the campaign in the 75th minute.
Raphinha played in Pedri, whose cross was palmed out by Padilla into Lewandowski's path and this time he made no mistake.
Barcelona's victory against Ernesto Valverde's Copa del Rey winners is another morale boost after their opening day win at Valencia.
Champions Real Madrid are widely expected to defend their crown after signing Kylian Mbappe but Flick's Barcelona have made a perfect start in their bid to snatch it back, despite various injury problems.
Frenkie de Jong, Gavi and Ronald Araujo are among those who will return later in the season for Barcelona, while Olmo is waiting for his chance too.