Scotland U21 0-1 Macedonia U21
Scotland's hopes of reaching the Under-21 European Championship finals next year were all but extinguished after defeat by Macedonia at Tynecastle.
Amid late drama, Liam Henderson was denied what appeared a legitimate goal before the Scots were given a penalty, only for the decision to be revoked.
Kire Markoski had drilled the visitors in front on 17 minutes.
And Macedonia held on despite a red card for Egzon Bejtulai and an injury to goalkeeper Igor Aleksovski.
Seven minutes of stoppage time were played after Aleksovski was hurt crashing against the frame of his goal as a Sam Nicholson delivery came off the inside of a post.
With Macedonia down to 10 men following two quick bookings for Bejtulai, and having used all of their substitutes, a hobbling Aleksovski had to carry on.
And the keeper was given the benefit of the doubt when Henderson prodded the ball away from his grasp and into the net.
There was a further let-off for Macedonia when the Romanian referee pointed to the spot after the ball struck a hand in the penalty area. However, after consultation with the assistant it was ruled the handball was by Scotland striker Oliver McBurnie rather than a Macedonia player and the decision was reversed.
With three matches remaining in Group 3, Ricky Sbragia's side trail Iceland - who beat Northern Ireland 1-0 - and Macedonia by seven points. France slip to third place after losing in Ukraine.
With just two wins from seven games and three away fixtures to come, Scotland have little chance of finishing on top of the section or being one of the four best runners-up.
Sbragia's side had impressed early on with some neat, controlled possession but the Macedonia defence, marvellously marshalled by Darko Velkoski, made sure any threat generally came from long range.
Aleksovski tipped over a dipping 30-yard drive from Stephen Kingsley before the visitors hit the front.
It was typical smash and grab stuff from a technically gifted side as they broke out of defence with pace and precision.
Boban Nikolov dropped into space and linked up effectively with Markoski, whose snap shot from just inside the penalty area flew under Liam Kelly.
The first half ended with Scotland on top, with the three Ryans - Gauld, Fraser and Christie - causing problems.
Jason Cummings sent a weak header straight at the keeper and the Hibs striker was then denied by a tremendous instinctive save soon after.
Aleksovski again did well to keep out a Jordan McGhee effort after the break.
Scotland looked like they were running out of ideas until Macedonia right back Bejtulai was sent off on 70 minutes for two yellow cards in the space of just a couple of minutes.
Substitute Nicholson nearly conjured up a fluke equaliser when his cross struck a post.
Then Fraser flashed a shot over and Christie's blast along the six yard line somehow evaded McBurnie and Cummings before the crazy conclusion in time added on.