Southend United substitute Anthony Grant capitalised a defensive clanger from Crewe Alexandra captain Julian Baudet to steal a dramatic win.
Grant headed the winner in a seven-goal thriller after home keeper Steve Collis had parried Dougie Freedman's shot.
The veteran striker dispossessed Baudet near the halfway line to complete an afternoon of misery for the Frenchman.
As early as the third minute his hesitancy let in Freedman on the edge of the six-yard box and the 34-year-old was able to roll the ball home.
Then when right-back Simon Francis' cross flew in, Baudet was unable to get out of the way and the ball cannoned off his knee for Southend's second in the 20th minute.
But Crewe staged a quick comeback. Michael O'Connor, who hit the post before Freedman opened the scoring, crashed home a deflected effort in the 24th minute and four minutes before half-time Tom Pope broke free on to O'Connor's long pass and steered home the equaliser.
Calvin Zola was guilty of a succession of poor misses, particularly when he was freed by Pope only to sky the ball high and wide.
Substitute Shaun Mlller injected some life down Crewe's left flank and when he set up Byron Moore for a stinging shot, Southend's American keeper Ian Joyce was glad to scramble the effort over the bar.
From the resulting corner on 66 minutes Zola made amends when he hooked the ball into the roof of the net, after Adam Barrett had failed to clear allowing Pope the chance to flick into his strike partner's path.
Southend weren't finished by any means though, Collis did well to deny Lee Barnard the near post.
Then Freedman was allowed far too much room to chest down another Francis cross and volley in the equaliser in the 69th minute.
O'Connor curled a free-kick on to the far post and substitute Hal Robson-Kanu almost caught out Collis with a long-range low angled drive.
It was the Shrimpers who sneaked victory with three minutes left, leaving Crewe first-team coach Steve Holland in despair with his side's defending.