Thomas Vermaelen was Barcelona’s unlikely goalscorer as the Spanish champions finally broke Malaga’s resistance to win their opening home league fixture.
Barcelona failed to score in either league game against Malaga last season.
A repeat looked increasingly likely as goalkeeper Carlos Kameni denied Lionel Messi four times in the second half.
But with 18 minutes to go ex-Arsenal defender Vermaelen volleyed his first Barcelona goal to secure the points.
Vermaelen has endured a difficult time at Barcelona since signing from Arsenal last August.
Injury restricted the Belgium international, 29, to just one appearance last season.
But he has started both of Barca’s league games so far at the start of their title defence and prompted huge relief around the Nou Camp when he finally found a way past Kameni.
The Cameroon international stood firm against Messi but when he pushed away a Luis Suarez cross at full stretch, Vermaelen showed fine technique to strike the winner from 15 yards out.
Barcelona were denied what looked a strong penalty appeal in the first half when Suarez was challenged by Marcos Angeleri after Javier Mascherano, who has never scored for Barca, had headed against the bar.
Malaga looked dangerous on the break and almost went ahead through a spectacular long-range effort from Juan Carlos which landed on the roof of the net after 20 minutes.