Juanmi grabbed the only goal of the game after just seven minutes when he pounced on an error by Dani Alves.
Thereafter, the hosts failed to breakdown a well-organised Malaga defence, which also frustrated the Catalans in a 0-0 draw earlier in the season.
Defeat leaves Barca still a point adrift of Real Madrid at the top of the table, but the European champions can extend that advantage to four points when they travel to Elche on Sunday.
“We’re used to these kind of games. I’d like it to be an accident but it is becoming habit, the opposition close up and we can’t find a way through,” lamented Barca boss Luis Enrique.
“These kind of results are sometimes a good reminder that other sides have their qualities. You could consider this a deserved defeat.”
It is the second time this season Barca have been shocked at home after a 1-0 reverse to Celta Vigo in November.
However, defeat was all the more of a surprise as Barca came into the game in fine form having won their last 11 games in all competitions, scoring 42 goals in the process.
Their star front three of Lionel Messi, Neymar and Luis Suarez were kept remarkably quiet as Malaga became the first side since Getafe in 2007/08 to keep Barca scoreless over two games in La Liga.
“They scored and shut up shop. They let us use the ball out wide and we tried, but the final ball wasn’t there and we didn’t create clear-cut chances,” added midfielder Sergio Busquets.
The opener arrived thanks to a huge defensive error as Alves under-hit a backpass to Claudio Bravo and Juanmi nipped in to slot home.
Barca nearly replied immediately as a corner fell to Rafinha Alcantara and his fierce drive was blocked on his own goal-line by Weligton.
Malaga could even have been further ahead at the break, though, had Ricardo Horta made a better contact on two occasions when he was unmarked inside the Barca area.
Messi nearly unlocked the Malaga defence with a lovely in-swinging cross that Andres Iniesta could only head into the grateful arms of Carlos Kameni.
However, the hosts looked devoid of ideas after the break as it was Malaga who posed the constant threat on the counter-attack, albeit without creating any clear-cut chances.
Luis Enrique turned to Ivan Rakitic and Pedro Rodriguez from the bench in the search for a breakthrough.
It was Pedro who had the best chance to level seven minutes from time when he was played in by Neymar, but the Spanish international could only fire the ball into the side-netting.
And it wasn’t to be for Barca as a dipping volley from Suarez was clutched by Kameni before the Cameroonian denied Gerard Pique in stoppage time.