Barcelona beat Girona 1-0 on Saturday evening thanks to a second-half goal from Pedri.
The match-winner replaced the injured Ousmane Dembélé after just 26 minutes of the derby and made his impact in the second half.
Girona were comfortable for large spells of the first half. Ansu Fati could have opened the scoring for Barcelona but blazed his effort over the bar.
Xavi was forced to change his plan when Dembélé was forced off, but his replacement came up with the all-important goal after 61 minutes.
Substitute Jordi Alba sent a cross in from the left and Girona shot-stopper Paulo Gazzaniga pushed it out into the path of Pedri, who tapped it into the empty net on his 100th game for the club.
In the 86th minute of the match, Girona’s Iván Martín had a glorious chance to equalise for the home team, but somehow shot wide when it was easier to hit the target.
Barcelona survived the late scares to hold on to the three points.
The win moves Xavi’s side six points ahead of Real Madrid, who play against Real Sociedad at the Santiago Bernabéu on Sunday night.