With Gerard Pique out injured, Oscar Minguez was handed a league debut by the Catalans who also recalled Philippe Coutinho and went with Martin Braithwaite up top.
Barcelona were denied a fast start when a goal-line clearance from Unai Garcia steered Coutinho's first-time shot from a cutback by Antoine Griezmann to safety.
Barca grabbed the lead a minute before the half-hour mark after Braithwaite bundled a looping ball from a double save by Sergio Herrera off shots by Coutinho and Braithwaite over the line.
Griezmann allayed the home side's nerves four minutes to halftime as the Frenchman latched onto a Jon Moncayola's headed clearance to send in a sumptuous volley.
Barcelona increased their advantage on 57 minutes after Coutinho rewarded manager Ronald Koeman for the recall with a tap-in from a square ball from by Griezmann.
Koeman's charges were given a big let off on the half-hour mark in the second half as Ruben Garcia played a cutback to Roberto Torres, who cracked the post from a close-range shot.
Barcelona looked to have netted a fourth goal on 70 minutes through a strike from Lionel Messi after being played in by Francisco Trincao, but it was brought back by the Video Assistant Referee (VAR) following a foul in the build-up.
The Argentine would go on to bag a goal after three minutes when he beat one challenge on the edge of the area from a pass by Trincao to drill into the top corner.
Barca were in the mood for more goals following the closing minutes, but had to settle for a four-goal victory in the end.