Inna Iegorova hit a three-pointer at the final buzzer to lift Ukraine to an 82-79 win over Slovenia in EuroBasket Women qualifying on Wednesday.
The victory keeps Ukraine's final round hopes alive in Group B.
Although it is impossible for Ukraine to finish in first place in the group, they could still have a chance to qualify as one of the four second-best placed teams.
Iegerova's three-pointer capped a remarkable fourth quarter display from Ukraine.
Slovenia were in complete control in the final period thanks to a 7-0 run to open play which established a 69-57 lead.
Slovenia led by 10 points with as little as 4:23 to go before Ukraine came storming back.
Iegorova hit a jump shot which sparked a 9-0 Ukraine run, but Mojca Markovic nailed a jumper with 1:16 remaining to give Slovenia a 79-76 lead.
Iulia Lapshynova split a pair from the line to cut the score to 79-77, and Slovenia then missed a golden opportunity to extend their advantage.
Maja Drozg grabbed an offensive rebound from a Katarina Ristic miss with 40 seconds to play, but was called for travelling.
Olena Krykunenk then made two clutch free throws for Ukraine with just 7 seconds on the clock to tie the game, 79-79.
Slovenia had the chance to hold for a game winning shot, but Drozg was once again the villain as she was called for another turnover to give the ball back to Ukraine.
Ukraine didn't make the same mistake as their opponents and Lyubov Alyoshkina found an open Iegorova for the game winning three-pointer.
Ukraine will look to solidify second place with a win over Israel in their final qualifier on Saturday. Slovenia take on group leaders Turkey.