Milan striker Zlatan Ibrahimovic converted the winner from the spot after substitute goalkeeper Damir Kahriman brought down forward Ola Toivonen on 51 minutes.
Kahriman had come on at half-time, replacing debutant Branimir Aleksic, who was at fault when he flapped at a corner to allow Toivonen to open the scoring.
Borussia Dortmund defender Neven Subotic had equalised for the Serbs, who fielded an experimental line-up with a full XI of first-teamers absent from a youthful squad.
Sweden face hosts Ukraine in their first match of the Euros, having been drawn in Group D, which also contains England and France.

