Stockholm: Sweden edged Serbia 2-1 in their final Euro 2012 warm-up match thanks to a second-half Zlatan Ibrahimovic penalty but they were helped by some goalkeeping errors from the visitors on Tuesday.
Serbia's substitute keeper Damir gave away the spot kick after coming on at halftime to replace Branimir Aleksic whose fumble at a corner allowed Ola Toivonen to give Sweden the lead before Neven Subotic equalised for the Serbs with a header.
Sweden, who face co-hosts Ukraine in their Group D opener in Kiev on Monday, controlled the early stages and Sebastian Larsson nearly scored in the fifth minute from 35 metres after Aleksic cleared the ball straight to him.
Just as Serbia began to find their feet, however, Sweden took the lead when Aleksic made a hash of a corner and the ball fell to Toivonen who had a simple tap in after 23 minutes.
Sweden's Andreas Isaksson then made a fine double save following a Zoran Tosic free kick just outside the area but Serbia levelled from the resulting corner when Subotic produced a fine header.
The visitors were the better side for the rest of the first half, forcing Isaksson to make several saves.
The Serbs brought on Damir for the nervy-looking Aleksic at the break but he soon dragged down Toivonen in the area after Rasumus Elm had opened up their defence with a slick pass.
Ibrahimovic, the top scorer in Serie A last season, buried the spot kick in the bottom right corner after 52 minutes.
Sweden controlled the rest of a slow-paced second half and could have extended their lead but for some good saves by Damir.
After facing Ukraine, Sweden will play England and France in the group stage of Euro 2012.