The AC Milan forward broke the deadlock in the second minute before teeing up Ola Toivonen 12 minutes later at the Gamla Ullevi in Gothenburg. Kolbeinn Sigthorsson narrowed the deficit in the 27th minute and although Christian Wilhelmsson restored the two-goal advantage, Hallgrimur Jonasson's stoppage-time strike ensured a nervy finale.
Victory over former national team manager Lars Lagerback's men was Sweden's first of two warm-up matches before they begin their European championship campaign against co-hosts Ukraine on 11 June.
They made a strong start this evening, Ibrahimovic firing them into an early lead with a stunning low volley from Sebastian Larsson's right-wing cross. Ibrahimovic's cross from the left side of the penalty area then allowed fellow striker Toivonen a close-range finish.
Sweden, who also play England and France in Group D, looked to be on their way to a convincing win, but they were pegged back when Sigthorsson headed home Ari Freyr Skulason's cross from the left.
Wilhelmsson then volleyed past Iceland goalkeeper Hannes Thor Halldorsson with 13 minutes remaining as Sweden looked to have wrapped up victory. But Iceland, who took a two-goal lead against France at the weekend before going down 3-2, refused to lie down. Jonasson converted Johann Berg Gudmundsson's corner, but the strike was too little, too late.