Late goals from Sergi Roberto and Luis Suarez saved Barcelona's blushes and earned them a valuable win over visitors Bayer Leverkusen in Champions League Group E.
Kyriakos Papadopoulos fired the Germans ahead with a 22nd minute header and the hosts struggled to assert their authority until two goals in 92 seconds finally turned the tide inside the final 10 minutes.
Sergi followed up an initial effort from substitute El Haddani Munir to bundle Barcelona level in the in the 80th minute and then Munir turned provider again to set up Suarez who lashed a right-foot shot into the roof of the net.
It was a crucial win for the hosts, who were once again far from from their best without injured talisman Lionel Messi, and face more problems after midfielder Andres Iniesta limped off on the hour-mark with what the club later confirmed is a hamstring injury.
Barcelona frequently found themselves unsettled by former Manchester United star Javier Hernandez, who brought a fine save out of Marc-Andre ter Stegen as early as the second minute, before visiting keeper Bernd Leno saved well to deny first Neymar and then Sandro.
Kevin Kampl missed two good chances before Leverkusen's opener, and but for a poor finish by Wendell after skipping past Gerard Pique 10 minutes before the break, the visitors could have extended their lead.
Neymar and Sandro came close to bundling an equaliser before the break but the Barcelona strike-force looked sluggish and once again it was Leverkusen who came closest to extending their lead when Hernandez skied a golden chance to make it 2-0 just after the interval.
Sandro came close again as Barcelona - possibly buoyed by the 54th minute substitution of Hernandez - produced their finest passage of play and they had another chance when Neymar almost turned a deflected shot from Ivan Rakitic past Leno.
Frustrations grew for Barca as the minutes ticked by and the visiting defence held firm, with Papadopoulos marshalling the back-line well and Leno confidently holding a close-range header from Pique.
Neymar cut an increasingly frustrated figure in the Barcelona strike force before the breakthrough finally came in the 80th minute when Jordi Alba set up Munir for his initial effort which would lead to Sergi's equaliser.
And Barcelona were celebrating again moments later when the excellent Munir cut into the Leverkusen box from the right and played a neat ball to Suarez, who needed no second invitation to flash it past the helpless Leno.