Maria Tzankova buried a last-gasp three-pointer at the Umcor U18 European Championship Women in Tenerife on Friday to send Bulgaria into the quarter-final round.
It was a cruel defeat for Poland, who will go to the classification round and can finish no higher than eighth in the tournament.
They trailed by as many as 16 points in the third quarter, but a 14-4 run saw Poland cut the lead to seven at the 30-minute mark, 47-40.
The comeback looked to be almost complete thanks to 7 straight points from Agnieszka Skobel, which put Poland in front, 52-55.
Bulgaria then held their nerve at the free throw line as Jaklin Zlatanova and Aneta Mitova each drained two attempts to re-take the lead, 56-55.
Lidia Kopczyk split a pair from the free throw line to tie the score, but Bulgaria replied immediately through Daniela Peteva.
Kopczyk made up for her missed free throw on the next possession with a driving lay-up and the scores were tied once again.
With 21 seconds to play, it was Tzankova who took the intiative. She ran down the clock and almost looked to have left it too late, but with 2 seconds to go, she took her defender right and elevated for the three-pointer, which found nothing but the bottom of the net.
Tzankova finished with a game high 20 points for Bulgaria, who made only two three-pointers all game, the second of which proved to be the game winner.
Skobel led Poland with 16 points.