La Liga: Almeria 1 Barcelona 2
Luis Enrique's men were in danger of suffering a third successive league defeat for the first time since 2003 as Thievy Bifouma gave the hosts a well-earned first-half lead, but goals from Neymar and Jordi Alba in the final 17 minutes secured the spoils for Barca.
The visitors were far from their clinical best as Lionel Messi again missed a chance to equal Telmo Zarra's La Liga goals record just a few days after matching Raul's landmark tally in the UEFA Champions League victory at Ajax.
And Thievy capitalised on their wastefulness in the 37th minute, producing a precise finish after charging away from the Barca defence.
The visitors appeared to be heading for another morale-sapping defeat in the league, but Neymar – introduced at the break along with Luis Suarez – bundled the Uruguayan's cross home in the 73rd minute to provide the spark for a turnaround.
Alba netted the all-important winner inside the final 10 minutes, with Suarez integral again, keeping Barcelona in the hunt at the top.
Luis Enrique surprised many by opting to leave both Suarez and Neymar on the bench in Andalucia, although Barca looked perfectly capable going forward early on despite their absence.
Messi was denied his record-equalling goal in the ninth minute, though, as he was twice thwarted from close range by Ruben in the Almeria net, with the goalkeeper also palming a Munir El Haddadi effort around the post.
After that let-off, the hosts seemed to grow into the encounter and with both Thievy and Jonathan Zongo causing problems, Barca looked particularly uneasy at the back.
Thievy tested Claudio Bravo following a clever run in the 22nd minute, but the home side should have been behind by the half-hour mark.
Ivan Rakitic saw his header kept out by Ruben and from the rebound Messi inexplicably nodded against the crossbar despite having an open goal at his mercy.
And Almeria made them pay eight minutes before the break, as former Espanyol attacker Thievy burst onto Fernando Soriano's throughball and coolly slotted past Bravo after outpacing the Barca defence.
Luis Enrique responded by introducing Neymar and Suarez at half-time and the latter almost drew Barca level in the 61st minute.
Almeria failed to deal with a corner and Suarez produced an acrobatic attempt at the back post, with only the crossbar keeping the hosts' lead intact.
Barca eventually restored parity, though, as Neymar turned in Suarez's low cross despite the best efforts of Ximo Navarro.
And the winner arrived soon after, as Alba steered in Suarez's cross to spare Barca's blushes.