Sergi Roberto came to Barcelona’s rescue with a brace to finally see off rock-bottom Almeria 3-2 as the LaLiga champions returned to winning ways.
The hosts looked set to stretch their winless run to four games in all competitions after twice being pegged back by opponents still in search of their first league win of the season.
But the 31-year-old latched on to a through-ball from Robert Lewandowski in the 83rd minute to grab the points which take his side back within four points of second-placed Real Madrid.
Xavi’s men were overwhelming favourites as they aimed to shrug off their recent poor run, and they started on top.
Joao Felix floated a free-kick just over the crossbar then Sergi Roberto saw his first chance well saved by busy Almeria goalkeeper Luis Maximiano.
Joao Cancelo was next up with an effort that he drilled straight at the keeper, before Fermin Lopez headed over from Ilkay Gundogan’s pinpoint cross.
Sergi Roberto blasted over from long-range on the half-hour mark before Barca finally made their seemingly inevitable breakthrough three minutes later when Ronald Araujo’s deflected effort fell to Raphinha who fired it into an empty net.
Lewandowski almost doubled Barcelona’s lead before Almeria snatched their chance to level four minutes before the break, Leo Baptistao lofting the ball over advancing Barca keeper Inaki Pena and surviving a VAR check.
Baptistao had a chance to put his side in front before the break but dragged an effort wide and normal service resumed early in the second period with substitute Ferran Torres and Lewandowski both denied.
Sergi Roberto grabbed his opener on the hour when he met Raphinha’s corner with a header at the near post to put Barcelona back in front.
But the lead lasted barely 10 minutes before the hosts were undone by a calamitous error by Pena, who dropped the ball in a collision with Araujo, allowing the alert Edgar Gonzalez to slide it into an empty net.
The hosts responded well, Araujo making up for his part in the equaliser by heading just wide, before Gundogan contrived to somehow miss his chance with the goal at his mercy.
Sergi Roberto finally grabbed what proved to be the decider in the 83rd minute when he ran on to Lewandowski’s ball through the middle to seal three hard-earned points.
Lewandowski almost added a fourth and the captain was denied a hat-trick deep into added time when his effort rattled back off the woodwork.