Barcelona reached the last 16 of the Copa del Rey but were given a scare by fourth-tier Barbastro in an entertaining 3-2 win on Sunday.
The record 31-time winners took a two-goal lead through Fermin Lopez and Raphinha, before Adria de Mesa pulled one back for the hard-working hosts, AFP reports.
Substitute Robert Lewandowski netted from the spot for the Spanish champions but Marc Prat smashed in a late penalty for the hosts, who refused to give up.
"It seemed like the match was over, (but) these games always get complicated," Barca coach Xavi told Movistar.
"It's a positive result, our play was positive in many moments, and we're in the last 16."
Barcelona took the lead early on when Frenkie de Jong chipped a ball over the top for Raphinha and Lopez arrived in the box at the perfect moment to tuck away the Brazilian's low cut-back.
Joao Felix headed in the second from a Lopez cross but was left fuming when it was disallowed for offside.
Replays indicated the forward was not in an illegal position, but video reviews are not used in the Copa del Rey until the last 16.
"I don't understand why there isn't VAR in this competition, even though these are lower level grounds," added Xavi.
Barbastro goalkeeper Arnau Fabrega saved free-kicks from Felix and Raphinha as the visitors dominated as expected at the 5,000 seater stadium.
Raphinha doubled Barcelona's lead from close range early in the second half after young defender Hector Fort whipped in a deep, swirling cross to him at the back post.
Former Barca youth player De Mesa pulled Barbastro back into the game just before the hour mark, prodding home from close range during a scramble in the box from a corner.
Xavi reacted by sending on 18-year-old Brazil striker Vitor Roque, recently arrived from Athletico Paranaense, as well as defender Inigo Martinez.
The Basque central defender only lasted a few minutes before limping off again, having only just recovered from a hamstring problem.
- Chances wasted -
Remarkably Barbastro could have levelled but Jaime Ara headed badly off target when well placed to score.
Ferran Torres was just as guilty at the other end, unable to capitalise when sent through, but Barbastro handed Lewandowski the chance to restore his team's lead from the spot.
Javi Lopez handled the Polish forward's header and he sent the goalkeeper the wrong way, gently rolling the ball into the other corner.
Barbastro pulled another goal back in stoppage time when Marc Prat smashed home a penalty following a foul by Lopez, but could not find another to force extra-time.
"We're letting in a lot of goals, it's something that we have to improve on," Lopez told Movistar.
Barcelona join Real Madrid and Atletico in the next round, after the capital clubs progressed on Saturday.
Villarreal's tie at Unionistas de Salamanca on Sunday was abandoned at the start of extra-time because of floodlight failure.
The third-tier side had pegged their La Liga visitors back in the final stages to level the score at 1-1 after 90 minutes in the round of 32 clash, in front of nearly 6,000 fans. Play will be resumed Monday at 1530 GMT.
La Liga side Las Palmas crashed out 2-0 at second division Canary Island rivals Tenerife in one of few shocks in the round.
Sevilla needed a late Juanlu Sanchez strike to see off second division Racing Ferrol 2-1 and progress, along with Athletic Bilbao, Osasuna, Mallorca, Real Sociedad, Valencia and Celta Vigo, who also beat lower league opponents.
The last 16 draw takes place Monday at 1730 GMT.