The champions came from three goals behind to trail 3-2 early in the second period, but a mistake from German goalkeeper Marc-Andre ter Stegen allowed Pablo Hernandez to score.
Phone Sisto opened the scoring in the 22nd minute and by the 33rd his team were three up, after Iago Aspas doubled their lead before Mathieu put through his own net to end a bizarre spell—but not an unprecedented one.
Gerard Pique headed home to start Barcelona’s comeback, and another stunning pass for Andre Gomes that led to Barcelona’s second.
The Portuguese midfielder went down in the box under pressure from Hugo Mallo, who grabbed his shirt, and referee Inaki Vicandi Garrido pointed to the penalty spot. Neymar scored from the resultant penalty kick.
But as Barcelona pushed for the equaliser, another Ter Stegen mistake set them back again. The goalkeeper’s nonchalant attempt at a chipped pass rocketed back off Pablo Hernandez’s face and into his net, with the Chilean midfielder hounding him down.
Still Luis Enrique’s team didn’t give up, with Pique heading home his second of the game after substitute Denis Suarez stood up the ball at the back post.