Substitute Luis Suarez orchestrated a second-half comeback win for FC Barcelona to bring an end to a three-match winless streak in the La Liga.
The Uruguayan striker created goals for Neymar and Jordi Alba as the Catalan giants moved top of the league standings on a temporary basis.
Thievy Bifouma opened scoring for Almeria, who are winless at home so far this season.
Lionel Messi has yet to break the La Liga scoring record after hitting the cross bar in both halves.
Both sides traded possession in the opening minutes of the encounter but the Andalucía hosts were resolute on not giving in to the continuous prodding by Leo Messi and Munir El Haddadi, the pair whose efforts were blocked in a scramble right in the mouth of goal.
Midfielder Ivan Rakitic came close to opening scores for Luis Enriques men in the 28th minute, when his header was saved by a diving Ruben.
Messi soon had his own header come off the woodwork before Almeria pulled ahead on 37 minutes.
The Argentina skipper lost the ball in Almeria’s half and after some neat exchange of passes, Thievy was sent through on goal; the Congolese striker blasting beyond Claudio Bravo and inside the right post.
Enrique introduced Neymar and Suarez after the break and the duo combined in the 78th minute to restore parity, as the Brazilian thumped home the equaliser from a low cross from the former Liverpool man.
The strike injected life into Barca’s game and the winner eventually surfaced after Messi had clattered another shot against the crossbar.
Suarez broke towards the end of line to send a delightful pass to right-back Alba, who swiftly tapped home from close range.