A moment of madness from Halifax Town goalkeeper Ian Dunbavin gave Carlisle United all three points in a tense game at Brunton Park.
With seconds of normal time remaining, United substitute Glenn Murray challenged Dunbavin, who in turn retaliated.
While remonstrating with referee Bob Pollock, Dunbavin carried the ball out of his area, conceding a free-kick which the quick thinking Murray tapped to fellow substitute Magno Vieira to fire home into the empty net.
Carlisle had dominated the second half and had a strong penalty appeal turned down before Dunbavin's farcical error.
The Shaymen had the better of the early exchanges and should have taken the lead when burly striker John Grant shot straight at Matt Glennon from 12 yards.
An even better chance fell to defender Greg Young, but he saw his powerful header tipped around the post by the in-form Glennon.
Cumbrians full-back Tom Cowan almost grabbed the lead when he narrowly missed a Peter Murphy cross before colliding with Dunbavin and rendering himself unconscious - although he came round seconds after being substituted.
Dunbavin's late error gave his team-mates little time to rescue a point, as despite their lengthy arguments with Mr Pollock the goal stood.