Ukraine met stiff resistance but finally put away the visiting Czech Republic in a do-or-die showdown in the EuroBasket Relegation Round on Thursday.
The Ukrainians prevailed 82-70 to finish 4-2 and secure their Division A status.
Defeat for the Czechs, who played at EuroBasket 2007, has sent them crashing into Division B with a 3-3 record.
In a gripping encounter, Ukraine rode a strong effort from Sergiy Lishchuk to open a 28-19 lead.
Lishchuk poured in 14 of those points for his team.
The hosts went in front by as many as 11 in the first half but didn't put Michal Jezdik's team away.
Instead the Czechs ended the second quarter with a 5-0 run and closed the gap to 36-30.
Oleksiy Pecherov had 12 of his game-high 21 points in the first half for Ukraine.
When play resumed, Czech baskets from Tomás Satoránský and Ladislav Sokolovsky trimmed the deficit to 36-34 and they eventually went in front after a jump shot by David Jelinek made it 39-38.
The lead changed hands 10 times over the next several minutes before a crucial three plays made by Ukraine's Dmytro Gliebov.
The 1.98m small forward caught a pass from Pecherov and made a jumper with 7:42 remaining to give his side a 60-59 advantage.
He then intercepted a pass from Petr Benda and went in for a lay-up for a three-point edge.
Satoránský split a pair of free-throws for the Czechs before Ukraine's Maksym Vilkhovetskyi drilled a three-pointer.
Jan Vesely drilled a jump shot for the Czech Republic but Ukraine replied with an 8-0 run that included a Gliebov basket, a three-point play from Pecherov and a three-pointer from Sergiy Gladyr.
That gave the home side a 73-62 lead with 3:44 remaining and Jezdik's team never recovered, getting no closer than seven points the rest of the way.