Latvia topped Finland 93-90 in their dead rubber game in Group A of the EuroBasket qualifiers.
Rising teenage star Sasu Salin had a moment he will want to forget as, trailing by three with three seconds left, Finland called a timeout to set up a potential game-tying play, but instead the young forward turned the ball over before a shot could be taken.
That capped a fourth quarter in which Latvia had rallied from eight points down with five and a half minutes left to grab victory.
Finland were up 84-76 when Salin made three of three free throws midway through the final stanza.
But Latvia came storming back.
Kaspars Berzins made one of three free throws before Ernests Kalve sank a pair and then capitalised on a turnover to nail a jump-shot that made it 84-81 with 4:22 to go.
Rihards Kuksiks tied it with a three-pointer before Finland edged back in front on Petri Virtanen's free throws.
Kuksiks again tied it at 86-86 with 2:50 to go and Latvia went ahead as Berzins returned to the line to sink two more free throws.
Gerald Lee responded to tie it from the foul line, and then did so again after Andrejs Selakovs lay-up put Latvia back in front.
But with 34 seconds left Selakovs hit another jump-shot and then in the dying seconds Janis Strelnieks made one of two from the line to pad the lead a little further.
Berzins led Latvia with 15 points, while Kalve had 14 and Kuksiks and Selakovs added 10 each.
Finland wasted 24 points from Lee while Salin had 14 prior to his error.
"Considering the circumstances and all the injuries, the team did well. We were missing a lot of key players and new kids stepped up to carry responsibility. We established good grounds to build onto in the future.
"Tonight we were not experienced enough to pull a win out of this game, though."
Finland Player Shawn Huff:
"It was good a fight, but we just could not keep things together all the way through. A couple of late turnovers and the fact that we were not able to get the stops we wanted on defensive end caused us the game."
Latvia Head Coach Ainars Bagatskis:
"In the first half we allowed Finland to score 50 points, which was way too much. In the second half we managed to stop their shooters and did well close to the basket. It was a tough game, the kind of, which will get you better."