FYR of Macedonia finally clinched their passage to a EuroBasket with an 87-74 home victory over Estonia.
The triumph secured first place in qualifying Group B, something that was made possible by Latvia's late defeat in Portugal earlier in the night.
FYROM and Latvia finished with 4-2 records, but the former had a +1 goal differential in their two meetings and that is why they finished top of the pool.
Latvia also reached the EuroBasket as one of the three best second-place teams.
Estonia, who have had some fine moments in this Division A campaign, dropped to 1-5 and will now play in the Relegation Round.
FYROM veteran Todor Gecevski had 18 points and six rebounds for the winners, whose fans will no doubt be partying until the early morning hours.
Victory was never in doubt, with Vrbica Stefanov's three-point play sparking an 11-0 run for a 19-10 FYROM advantage with 4:11 left in the first quarter.
By the end of the frame, the lead had ballooned to 32-14 and with just over three minutes to go in the first half, the game had turned into a blowout as FYROM were in front at 46-22.
Jovica Arsic's team went on top at 58-29 with 7:39 to go in the third quarter on a three-point play from Gecevski.
In the fourth quarter, with victory assured, FYROM took their foot off the pedal and that allowed Estonia to make the scoreline look more respectable.
But it couldn't hide the fact that Estonia will now, after losing five straight games following their opening qualifying game win in Portugal, have to fight for their Division A status in the Relegation Round.
Pero Antik had 16 points for FYROM and Stefanov 11.
Kristjan Kangur scored a game-high 19 in defeat for Estonia, who hit 14 of 29 from long range but were just five of seven at the line compared to FYROM's 16 of 25.
Estonia also turned the ball over 19 times while the home side had just 10 turnovers.
Ullar Kerde, Estonia coach:
"It was a good game. Macedonia dominated in the first half, we came back, and played a good second half. I have a young team, we tried our best. We also missed our guard Sokk, who was injured."
Valmo Kriisa, Estonia player:
"Macedonia had a cracking start to the game, we played poor defensively, that was the key to our loss."
Jovica Arsic, FYR of Macedonia coach:
"I am very content with the win, which gave us the first place in the group. Estonia is a solid team, they deserve their praise. Going to Poland as group winners is a big plus for us."
Vrbica Stefanov, FYR of Macedonia player:
"Winning and qualifying for Poland is a big success. We played an excellent first half, which was decisive for our victory."