Barcelona's Antoine Griezmann struck a late double to help them come from behind to beat Spanish third-tier side UD Ibiza 2-1 and avoid an embarrassing Copa del Rey last-32 exit on Wednesday.
Javi Perez put Ibiza ahead after nine minutes and the hosts had a second goal disallowed before Rai Nascimento hit the post with Barcelona floundering.
Quique Setien's side dominated the ball, as they did on the coach's debut against Granada last weekend, but created no chances until Griezmann fired home in the 72nd minute.
The French forward then drilled in the second goal in the 94th minute to prevent extra time and send last year's runners-up into the last 16.
This is the first edition of the competition since it switched to a single-match format so Barcelona had no return at the Camp Nou to fall back on, although they did not play as if that were the case.
Setien left Lionel Messi at home and played youth talents like Riqui Puig and Ansu Fati along with some first-team regulars, hoping that blend would be enough to take the record 30-times champions through.
Operating in a new 3-4-3 system, however, Barcelona did not get going and the hosts took full advantage, leading for over an hour.
"We didn't have a single shot in the first half, it was a new system and we had to get used to it," Griezmann told DAZN.
"We have to build confidence with the ball, move more in attack, understand the coach's tactics.
"We did a good job, especially in the second half, and I have to thank my team mates for the passes that let me score. I had two chances and they went in."