Barca, and particularly Lionel Messi, had been brilliant in the last three matches as they swept aside Valencia, VfB Stuttgart and Real Zaragoza in the space of a week, scoring 11 goals in the process.
But the Catalans took a long time to get going in this match against a well-drilled Osasuna outfit and the scores remained level with 20 minutes remaining.
And with Messi not quite at his brilliant best from the past week, it was left to the much-criticised Ibrahimovic to rescue Barcelona from a potentially complicated situation.
"We struggled to tighten up and support each other. We lacked the fluency I had imagined. I have made a mistake, I imagined a game that has not happened. In the sixth minute I decided to change it. When Pedro plays with Dani [Alves], both are good," admitted Barca coach Pep Guardiola.
On Ibrahimovic, Guardiola added: "When he scores we do well, because he is a goalscorer. His quality depends on himself and nobody else."