Greece beat Latvia 71-68 but failed to advance into the Qualifying Round at the U18 European Championship Men in Hagondange, France.
The Greeks entered this game needing to beat their opponents by at least five points in order to move on to the next round, while a loss by four points or less would see Bulgaria advance.
Greece, winners of this tournament last year, will now play in the 12th-16th place games.
After the game, Latvia head coach Janis Rimbenieks heaped praise for his players' efforts and determination.
"We never gave up hope. This is the hardest I've seen us play so far in this tournament. We deserve to go through to the next round," he said.
Asked whether this was one of the best defeats in his time in charge of the team, he laughed at the notion.
"We came into this game aiming to win, nothing else. But then when the game was nearing an end, we realised that winning it was maybe too much to go for so we played the points game."
With the momentum in their favour, Greece took their first double-digit lead, 62-51 in the first minute of the final quarter, but soon lost their touch, going without a single point for more than four minutes at one stage.
Latvia used that stretch to close within two, 64-62 on Harijs Rubenis' off-balanced shot with 4:05 left to play.
Linos Chrysikopoulos came to Greece's rescue, scoring consecutive lay-ups for a 68-62 edge with under two minutes left in the game.
Latvia came back within four once more, 68-64, before Chrysikopoulos buried a three from the left corner with 43 seconds to go to go back up 71-64
Greek players began celebrating, but perhaps a bit too early as Ugis Pinete answered with a long bomb of his own to cut the deficit back to four.
Greece turned to Chrysikopoulos once again but he missed a shot in the closing seconds and Pinete made one of two free-throws for the final scoreline.
The game was close in the first half. It was high scoring in the first quarter with the teams knotted at 25 all.
The frenetic pace and outstanding accuracy dropped off in the second quarter but it remained close as the lead changed 13 times and the score was tied eight times before the break.
Greece led 45-44 at the half and gradually pulled away late in the third quarter, behind the strong play of Ionnais Karathanasis, before cooling off in the final frame, getting outscored 17-11.