Frenkie De Jong scored a late winner as Barcelona edged past struggling Alaves to move up to fifth in La Liga.
The Netherlands midfielder converted Ferran Torres’ first-time cross with three minutes remaining.
Xavi’s side dominated possession but it was Alaves, 19th in the table, who had the better chances.
Pere Pons fired straight at Marc-Andre ter Stegen shortly before half-time, while Joselu flashed a header wide in the second half.
The win moves Barca to within a point of fourth-placed Atletico Madrid, who they host at the Nou Camp next weekend.
Barca looked weary after back-to-back extra-time defeats over the past week, to Real Madrid in the Spanish Super Cup last weekend and Athletic Bilbao in the Copa del Rey on Thursday.
They enjoyed 76% possession and had 10 corners to Alaves’ one, but struggled to create many clear-cut openings.
A turgid match looked to be drifting to a goalless draw when Torres, signed from Manchester City earlier this month, ran onto Jordi Alba’s chipped ball over the top and laid the ball back for De Jong to finish from close range.