Austria were on course to join second-placed Sweden on 17 points in Group C after Martin Harnik's 29th-minute strike gave them the lead. However, Sweden drew level soon after the interval through Martin Olsson and star striker Ibrahimovic then struck the winning goal with four minutes left to ensure his side will finish second in Group C behind winners Germany.
A disappointing second half for Austria was summed up when they lost Stoke striker Marko Arnautovic to a straight red card in the closing stages. It was looking a lot more promising for the visitors an hour earlier as a neat finish Harnik put them in front, the Trabzonspor forward sweeping the ball home at the far post following Marc Janko's lay-off.
Sweden may have felt unlucky to have been a goal down at that stage as Alex Kacaniklic, Ibrahimovic and Johan Elmander had all been denied by visiting goalkeeper Robert Almer before that, but the hosts could also just as easily have been 2-0 behind moments later as Andreas Isaksson superbly denied David Alaba with his feet.
Isaksson then saved from Aleksander Dragovic as the visitors sought a second goal before the break.
Sweden held firm though and then drew level ten minutes into the second half when Olsson headed home Ibrahimovic's cross.
Boosted by that goal, the home side turned up the pressure and Ibrahimovic and Anders Svensson drew fine saves out of Almer.
Despite that, it looked as though Sweden would have to settle for a point as the match edged towards full-time still locked at 1-1, but captain Ibrahimovic had other ideas as he brilliantly brought down Olsson's long ball forward before slotting a left-footed shot past Almer to seal the win.
Sweden will have been hugely relieved to have got the victory as their final match pitches them against Germany, while Austria, who saw Arnautovic dismissed for violent conduct late on, travel to basement dwellers Faroe Islands.