Andriy Totovytskiy struck deep into added time to move Ukraine to within three points of UEFA European Under-21 Championship qualifying Group 5 leaders Croatia.
Having already drawn 1-1 in Croatia and won 5-2 in Liechtenstein over the last fortnight, both times coming from behind, Ukraine were looking for three more points and went ahead on 54 minutes through Vladyslav Kalitvintsev. Vladislavs Gutkovskis soon levelled, though, and it was not until the fifth added minute that Totovitskiy clinched victory.
Latvia themselves needed three points to stay in the play-off hunt but fell behind when Kalitvintsev – who had hit the bar in the first half – headed in Vladimir Kostevych's precise cross from the left. Nine minutes later it was 1-1, Gutkovskis pouncing on an Anton Bratkov back-pass and shooting into an empty net. Ukraine had dominated throughout, and continued to press hard, finally getting their reward when goalkeeper Maksym Koval's long clearance went into the Latvia box where Ivan Ordets set up Totovitskiy to score.
With a game in hand on Croatia, Ukraine are a point ahead of Switzerland who they host on 4 September knowing victory would ensure a top-two finish. They then welcome Liechtenstein four days later and another win could take Ukraine to the play-offs even if Croatia, who have a superior head-to-head record, win in Latvia on 3 September.