Barcelona booked their place in the last 16 of the Copa del Rey despite an unconvincing display in a 3-2 victory over fourth-tier Barbastro.
Fermin Lopez, Raphinha and Robert Lewandowski were on target for Xavi’s side in a match which also saw their opponents score twice through Adria de Mesa and Marc Prat.
LaLiga giants Barca lacked a cutting edge and presented chances to Barbastro in what turned out to be a hotly-contested tie.
Barca were camped in the attacking third before they took a 1-0 lead in the 18th minute.
The visitors won possession in midfield before Raphinha was found out wide. The Brazil winger stormed forward and picked out Lopez, who expertly scored with a first-time shot to give his side the advantage.
After 41 minutes the Spanish champions thought they had doubled their lead but Joao Felix’s effort was ruled offside.
Lopez turned creator and floated a ball on to the head of the potent Felix, who nodded his effort past Arnau Fabrega. The Portugal international appeared to have perfectly timed his run but Barca were denied the chance to add another.
The Catalan side strengthened their position in the 51st minute through Raphinha.
Seventeen-year-old full-back Hector Fort cut inside and sent a dipped ball to the back post where the former Leeds winger evaded his marker and volleyed home to make it 2-0.
But on the hour Barbastro scored an unlikely goal to halve the deficit.
The hosts sent men forward for a corner and a whipped delivery into the area challenged Barca’s defenders, who failed to clear their lines. Barbastro striker De Mesa was alert and got on the end of the loose ball to grab one back.
Xavi turned to the bench and brought on Lewandowski. The Poland striker instantly had an impact, winning a header and forcing an error from the defender whose backwards pass to keeper Manas was intercepted by Ferran Torres.
But typical of Barca’s day, Torres failed to hold his nerve and a poor touch saw the opportunity go begging.
Lewandowski sealed the tie when he scored from the spot in the 88th minute.
After a clear handball in the box, the former Bayern Munich star hopped, skipped, jumped and sent Manu the wrong way as he rolled his effort into the bottom-right corner.
Prat also scored from the spot in added-time but it was too late and Barca sealed a 3-2 win.