Anete Steinberga missed a last gasp shot which would have lifted Latvia to victory over Slovenia at the Termosteps U16 European Championship Women Division B.
However, Slovenia's 78-77 win was not enough to earn a semi-final berth and it is Latvia who advance to Saturday's semi where they will take on Romania.
In need of a victory by seven points or more to finish above Latvia in the standings, Slovenia threw caution to the wind in a thrilling second half performance. Defense went out of the window as the Slovenians went all out to establish a lead.
Latvia, however, replied in kind and had an answer for every Slovenian assault.
In a thrilling third quarter, the lead changed hands seven times and both sides combined for seven three-pointers.
Neither side were able to build any kind of lead in the final quarter and it looked as though the game would go into overtime. However, Bojane Duric's jump shot put Slovenia in the lead.
Latvia had two chances to steal the win, but Anete Cunda blew two free throws, and although Steinberga came up with an offensive rebound from Cunda's second miss, her shot was off the mark.
Steinberga led Latvia with an impressive 21 points and 19 rebounds.
Slovenia's Nika Baric topped all players with a game high 26 points.