The shooting took place on Wednesday night in a residential part of Kista in the northwest of the Swedish capital, not far from a school.
"At 10.06pm we were alerted to two people being found with gunshot wounds in Kista. A caller mentioned that a car had disappeared at high speed," Stockholm police spokesperson Anna Westberg said.
Police arrived shortly after and drove the two men to Karolinska University Hospital in Solna rather than wait for an ambulance, which they do in emergency situations when they are first on the scene.
One of the men died an hour after the shooting, while the other died just after 4am on Thursday. Tabloid Aftonbladet reports that the men were shot in the head, but that has not been confirmed by police.
A technical examination of the scene is complete and the car in which the men were found has been seized. A preliminary investigation into murder has been launched, and no arrests have yet been made.
Police said they did not want to speculate on what may have motivated the shooting, but have not ruled out a link with gangs.
"That's not something to hide. We have had, and have, a number of conflicts between criminal elements in the region. We can't say that this is because of that or something else, but it's not out of the question," Stockholm police press spokesperson Lars Byström told news agency TT.
Police are investigating whether there could be a link between the killings and a double murder in the Stockholm area from earlier this week, but noted that it is too early to say whether that is the case.
READ UPDATE: Kista shooting linked to gang crime, say police