Ryan Hardie netted a stoppage-time equaliser but Scotland Under-21s suffered a major blow to their European qualifying hopes after being held to a 1-1 home draw by 10-man Latvia.
Roberts Uldrikis headed Latvia in front in first-half stoppage-time and Scotland struggled to make their pressure count after a 67th-minute sending-off.
The Scots were handed a lifeline during five minutes of injury-time when visiting captain Antonijs Cernomordijs was penalised for pulling Scott McKenna, and substitute Hardie drilled home the spot-kick before Stephen Mallan missed a chance to win it.
But the slip-up in front of 1,449 fans in Perth saw Scotland fall six points behind leaders England and c oach Scot Gemmill saw Hearts defender John Souttar go off after picking up an injury.
The hosts enjoyed the better of the first half but could not sustain pressure, although they were not helped by a seven-minute delay after a McDiarmid Park floodlight failed.
Lewis Morgan and Mallan threatened from decent long-range efforts and the former beat the Latvian left-back several times but could not find a telling delivery.
Scott Wright failed to react when Liam Smith’s cross fell right in front of him 10 yards out and Scotland’s best first-half chance came when Oli McBurnie weaved his way into the box and appeared to be fouled. But the Swansea striker stayed on his feet and saw his drive stopped by the goalkeeper.
Scotland fell behind six minutes into stoppage-time after Smith’s attempted clearance went straight to an opponent. Ravis Jurkovskis headed against the bar from the subsequent delivery and the home defence and goalkeeper Ryan Fulton were slow to react as Uldrikis nodded home the rebound.
There was more urgency from Gemmill’s side after the restart. McBurnie and Wright threatened before both players combined and the visiting goalkeeper touched wide the Swansea player’s flick.
Mallan curled a free-kick on to the roof of the net after McBurnie and Schalke midfielder Andrejs Ciganiks had been booked following a flare-up.
Hardie came on for right-back Smith in a reshuffle and forced a good save seconds later after McBurnie’s through ball.
Ingars Stuglis was shown a straight red card for an awful challenge on Chris Cadden after being out-muscled by the Motherwell player, b ut Scotland struggled to find a way through a crowded penalty box and their crosses were not good enough.
Hardie and Morgan shot wide from half-chances and Greg Taylor saw an effort saved before the late drama.