Barcelona came from a goal down at Almeria to win 2-1.
Former Espanyol striker Thievy Bifouma had given the hosts the lead before half-time against a Barca team that started without mainstays Neymar, Luis Suarez, Gerard Pique, Dani Alves and Xavi Hernandez.
But Luis Enrique made decisive changes at the break in an attempt to avert a third straight league defeat, bringing on Neymar, Suarez, and later Xavi.
The Brazilian forward grabbed the equaliser thanks to a pass from Suarez and then the Uruguayan also played in Jordi Alba for the winning goal in the 82nd minute.
"This was our worst game of the season," said Enrique.
"The best thing about this game is the result and how we were able to finish. We've got a lot to work on."
For the big stories and the banter follow us on Twitter: @tribalfootball