Scotland dropped vital points at home to Ukraine in their fourth European Under 21 Championship qualifier.
Dmytro Khlobas put the visitors in front after Dominic Hyam's mistake midway through the first half.
But Jason Cummings' header and Callum Paterson's neat finish had Scotland ahead at the break.
Oleksandr Svatok levelled for Ukraine, who could have won it but for Hyam taking out Denys Bezborodko when the striker had the goal at his mercy.
That Ukraine counter-attack in added time had Bezborodko bearing down on goal having already knocked it past the on-rushing Scotland goalkeeper Jack Hamilton outside the box.
Hyam's decision to fell the raging forward therefore almost definitely saved the hosts from what would have been a sore defeat.
Bezborodko netted after the whistle had blown for the foul and the Ukrainians were upset the referee did not play the advantage.
Bottom side Ukraine claim their first point in Group 3, while fourth-place Scotland move on to five. Ricky Sbragia's side have played a game fewer than leaders Iceland, who have 11 points, and the Scots' next group fixture is away to France in March.
Only the group winners automatically qualify for the finals, with the best four runners-up of the nine groups claiming a play-off place.
But Scotland's early ambitions of finishing first or second were challenged when Ukraine took the lead midway through the first half at St Mirren Park in Paisley.
Hamilton had already brilliantly denied Ihor Zhurakhovskyi before being beaten by a low strike by Dmytro Khlobas, who bore down on goal and let rip after Reading defender Hyam had surrendered possession 30 yards out.
Billy King and Liam Henderson had missed good chances prior to Ukraine's opener, and Sbragia's side - being watched by senior team coach Gordon Strachan - were soon back on level terms from a well-worked free-kick.
It was made in Leith, with captain John McGinn's set piece landing on the head of his Hibernian team-mate Cummings and looping neatly beyond Bogdan Sarnavskyi.
Ukraine's keeper was soon picking the ball out of his net again thanks to Paterson's adventure into the six-yard box.
The Hearts right-back was in the right place to stab Cummings' low cross from the left into the roof of the net to give Scotland a half-time advantage.
Henderson missed a glaring opportunity after the break following good build-up play by Cummings and King, then Andy Robertson - down from the senior team to help the youth cause - hit the post with a speculative effort.
But overall in the second period Scotland were hanging on, with Khlobas almost getting his and Ukraine's second and Ihor Duts narrowly shooting over from distance.
The pressure eventually told and, after a long shot cannoned around in the area, Svatok slammed the ball home for the equaliser.
Scotland nearly replied immediately but Cummings' angled effort came back off the crossbar in the closing minutes, before that frantic few minutes in which Hyam intervened to prevent defeat.