Pedri scored the winner as Barcelona edged past Celta Vigo to return to the top of La Liga on goal difference.
The 19-year-old reacted quickest to turn home from three yards, after Gavi’s cross from the left was cut out, for his second goal of the season.
It was a disjointed performance from Barca, with Celta pushing after going behind, coming closest when Jorgen Strand Larsen had a header disallowed.
Iago Aspas also saw an effort saved, while Goncalo Paciencia hit a post.
Real Madrid had gone top of the league with a 1-0 win at Getafe on Saturday.
Both sides have won seven and drawn one of their opening eight league games, and face each other in the first El Classico of the season next Sunday (15:15 BST).
Barcelona, who have lost two of their opening three Champions League group games, started strongly with former Manchester City winger Ferran Torres curling wide before summer signings Raphinha and Robert Lewandowski saw efforts saved.
Xavi’s side lacked cohesion and quality for large parts of the game, while Celta improved after going behind but failed to show a clinical edge in the final third to earn a deserved point.
Barcelona have now only conceded one goal in the league so far this season and have kept four clean sheets in four home games.