A win over Montenegro on Monday was all Sweden needed to book a Round of 16 ticket with a game to spare, but a 87-81 loss put the Montenegrins in pole position to finish fourth in the group, needing only a victory over winless Great Britain to progress.
But the British saved by far their best performance until their elimination was sealed, taking the six-point win.
Therefore, a win for Sweden over Lithuania would see them finish fourth, though a loss would see the three-way fight for fourth decided on points difference, and only a defeat by over 50 points would see the Swedes lose out to Montenegro.
However, the Blagult were not intending to limp into the next round, as they were never behind in the entire first half and never relinquished the lead after Pelle Larsson put them 4-2 ahead in the second minute, before Larsson and Lugvig Hakanson contributed to grow that lead to 10-2.
Sweden maintained a healthy lead for the rest of the opening quarter, which extended to nine points in the final minute through Barra Njie's layup, before Deividas Sirvydis cut the gap to seven, at 21-14.
Things got better for Sweden at the start of the second when Denzell Andersson scored all six in a 6-2 run. The 11-point margin that created was still intact until 05:40 left in the half, when the pendulum swung Lithuania's way.
Azuolas Tubelis and Jonas Valanciunas were the spearheads in an attack that put together a 16-5 run to reduce the deficit to 36-32, before a crucial three in the last minute from Larsson allowed Sweden to hold a 39-33 at the half.
But the Lithuanian pressure didn't let up over the half-time break, as early in the third quarter they not only closed the gap and went in front for the first time when Valanciunas gave them a 44-43 lead, but outscored their opponents 16-4 in the first 03:50 to go 49-43 ahead.
Melwin Pantzar tied things up again at 51-51 as Sweden hit back, but a Sirvydis three-pointer ensured "the other Dream Team" led 54-53 with 10 minutes to play.
A couple of threes from Tobias Borg nudged the Blagult back in front at the start of a dramatic final quarter that saw the lead change hands six times, more than it had for the rest of the match combined, as Sweden struggled to stop Valanciunas in the paint at at the free-throw line.
A Larsson layup to put Sweden 67-65 up with 03:20 to do prompted a timeout from Lithuania head coach Rimas Kurtinaitis, which was used to full effect, as his side then put together a match-winning 8-2 run, with Arnas Velicka scoring six points in that streak.
Larsson had the chance to level matters from beyond the arc with 10 seconds to play, but his miss allowed Lithuania to hold on for the 74-71 victory that sees them finish second in the group, regardless of the result between Germany and Finland later today.
A fourth-place finish was the target for Sweden ahead of the tournament, and that's what they achieved thanks to their points difference of -15, compared to -77 for Montenegro and -130 for Great Britain.
They will now be huge underdogs in their Round of 16 match on Saturday against the winner of the game this evening between Turkey and Serbia.
The Miami Heat's Larsson and the Denver Nuggets' Valanciunas top-scored with 18 points each, while Tubelis scored 12 points and took 12 rebounds. Velicka's seven assists was the most in the game, one ahead of Njie's total.