Germany will meet Bulgaria and Sweden will take on Montenegro in the semi-finals of the U16 European Championship for Men Division B after a thrilling Friday in Sarajevo.
Most of the drama was in Group F with Bulgaria (2-1) edging Finland 76-74 to finish in second place ahead of Slovenia (2-1).
The Slovenians would have advanced to the last four had they defeated Sweden (2-1) but the Scandinavians prevailed 83-69.
Finland almost beat the Bulgarians, with the game knotted at 72-72 following a lay-up by Markus Molenius.
Stanislav Stoev's three-point play with 1:10 remaining put the Bulgarians back in front at 75-72, but a basket from Daniel Dolenc trimmed the Finnish deficit to just one with 39 seconds remaining.
Pavlin Ivanov split one of two at the line for Bulgaria with 13 seconds to go for a 76-74 lead.
After Finland grabbed the rebound on the missed second free throw, they took the ball up the floor with a chance to tie or go in front.
Villematti Kopio, who had hit seven of his 13 three-pointers in the game, took aim again from long range but missed as Bulgaria survived and advanced to the semi-finals at the expense of Slovenia.
In Sweden's big win, meanwhile, Carl Gaddefors poured in 18 points for the victors.
In Group E, Kevin Bright scored 12 points and pulled down seven rebounds for Germany in a 70-55 triumph over Montenegro.
The Germans stormed into a 23-10 advantage by the end of the opening quarter, only for the Montenegrins to hit back and trail 35-32 at half-time.
Three times the game was tied in the third quarter and Montenegro only faced a 46-44 deficit with 2:29 remaining in the frame.
But Joey Ney drilled consecutive three-balls for the Germans for a 52-44 advantage, and Sebastian Fülle started the fourth quarter with a three-point play.
Germany stayed on top the rest of the way.
Despite the defeat, Montenegro advanced to the semi-finals by virtue of their second-place finish in Group E.
The winners of the semi-finals will clinch promotion, and then take on each for the Division B title.