The visiting side had failed to score or win any points in their previous four trips to the Camp Nou Ã¢â‚¬â€œ conceding 15 goals in the process Ã¢â‚¬â€œ but were able to hold their heads high following a gallant defensive display.
Barca began proceedings, as they so often do, dominating possession and Lionel Messi fired a couple of early warning shots at Diego AlvesÃ¢â‚¬â„¢ goal Ã¢â‚¬â€œ pulling one just wide and forcing a save out of the Brazilian with his second effort.
Victor Valdes almost presented Almeria with the ball just yards from goal after spilling a cross played in from the by-line on 17 minutes. Luckily for the Barca number one, his defenders were on hand to scramble the ball clear.
Two minutes later, Xavi thought he had put his side ahead.
Ibrahimovic Ã¢â‚¬â€œ celebrating his 28th birthday Ã¢â‚¬â€œ skipped past his marker to chip in a ball for Xavi at the far post. The Catalan playmaker struck a left foot volley from six yards that deflected against the goalkeeperÃ¢â‚¬â„¢s foot and rebounded off the post back into the goalmouth.
Pedro slid in bravely, only to see his effort strike the same post and rebound out for a goal kick.
Xavi again came close on 19 minutes by heading PedroÃ¢â‚¬â„¢s cross over following more patient build-up by the home side.
Barcelona saw a penalty appeal turned down on 23 minutes.
Messi drove purposefully into the box and drew a lunging challenge from Bernardello that appeared to evade the ball and connect with the ArgentineÃ¢â‚¬â„¢s knee – sending him to the ground.
The referee, Carlos Carballo, waved his claim away and rushed over to this yearÃ¢â‚¬â„¢s Ballon dÃ¢â‚¬â„¢Or favourite to warn him of what he clearly believed to be simulation on MessiÃ¢â‚¬â„¢s part.
Almeria held the home side at bay stoutly until PedroÃ¢â‚¬â„¢s piece of individual brilliance on 31 minutes.
The 22-year-old, recently promoted from the Barcelona B squad, received MaxwellÃ¢â‚¬â„¢s pass inside the area with his back to goal, but swivelled superbly to hit the ball beyond the reach of Diego Alves and into the top right-hand corner.
Barca needed to produce something special to break a side that had been well-drilled by Hugo Sanchez – a former Real Madrid great hell-bent on halting the progress of his old foes.
After the break, the Mexican legendÃ¢â‚¬â„¢s side almost snatched an equalizer as the home side fell asleep after UcheÃ¢â‚¬â„¢s headed flick-on found Guilherme being played onside by a deep-lying Puyol. The Brazilian flashed a ball across the goal that had to be cleared with desperation at the far post by Maxwell.
Almeria worked extremely hard all over the pitch to frustrate Barca and it made for a fairly lacklustre seond-half.
Messi saw a low drive from the edge of the area deflected just wide of the left-hand post shortly after the hour mark, and his strike-partner Ibrahimovic had a right-footed drive tipped over the bar on 77 minutes.
Almeria showed greater adventure in the final quarter of the game following the introduction of their Ã‚Â£7 million Argentine summer-arrival Pablo Piatti.
The dominative striker injected some pace in the away sideÃ¢â‚¬â„¢s attack and had to be stopped illegally by Puyol on 79 minutes as he sped towards goal Ã¢â‚¬â€œ a challenge that resulted in a booking for the Barca captain.
Barcelona had to hang on for the final moments of the game, but claimed an important three points as they look to build further pressure on Real Madrid ahead of their clash with third-placed Sevilla at the Estadio Ramon Sanchez Pizjua on Sunday.
Barcelona: Valdes, Dani Alves, Puyol, Marquez (Pique, 60), Maxwell, Busquets (Toure, 76), Xavi, Iniesta, Pedro (Keita, 76), Ibrahimovic, Messi
Almeria: Diego Alves, Pellerano, Chico, Acacsieste, Michel, Bernardello, Crusat (Nieto,73), Ortiz (Soriano, 79), Guilherme, Uche (Piatti, 66)
Man of the Match: Pedro Ã¢â‚¬â€œ Despite BarcaÃ¢â‚¬â„¢s dominance, it required the young SpaniardÃ¢â‚¬â„¢s sublime solo effort to bag all three points and apply the pressure on title-rivals Real.
SaturdayÃ¢â‚¬â„¢s other La Liga results:
Tenerife 0-1 Deportivo
Atletico Madrid 2-1 Zaragoza
MORE: Man United latest news
MORE: Arsenal latest news
MORE: Chelsea latest news
MORE: Liverpool latest news