After defeats to Finland and Germany, Sweden got off the mark with victory over Great Britain on Saturday, while Montenegro had lost all three of their matches so far by decent margins.
That meant a win for the Blagult would not only eliminate the Montenegrins but all but seal their place in the knockout stages, as Great Britain would need a minor miracle to take fourth place from them.
However, the six-point loss at the Nokia Arena has put Montenegro in the driving seat with one match each left to play.
Head-to-head results taking precedence over points difference means that if Sweden fail to beat Lithuania in their final group match on Wednesday, they will require Great Britain to beat Montenegro to keep them in fourth place.
Things could have been worse for the Swedes had Barra Njie not cut Montenegro's lead at the end of the first quarter to 18-15 after a 6-0 run earlier on had but the Balkan side in control.
But an identical run at the start of the second kept Montenegro on top, eventually taking a 40-32 lead - their biggest of the half, before going in six points clear at the half.
The third quarter, however, was a different story; Simon Birgander and Pelle Larsson came into their own in attack, as Sweden not only scored 31 points - three short of their entire first-half total - but a Birgander tip-in to end the quarter gave them a 65-64 lead with 10 minutes to play.
75-70 ahead, the Swedes seemed to be doing enough to earn the win, but Montenegro had other ideas in the final 04:17, going on a 17-6 run in which Kyle Allman scored 10 points, and held out for an 87-81 win.
The Miami Heat's Larsson top-scored in the match with 28 points, while Nikola Vucevic of the Chicago Bulls scored 23 points and added a game-high 15 rebounds. Allman's seven assists put him clear of Larsson, with four, while Birgander was the Swedes' best rebounder, with 10.