The Shrimps had trailed to Brandon Thomas-Asante’s goal going into a minimum five minutes of added time at a wet and windy Mazuma Stadium.
The fourth of those saw Carlos Mendes Gomes level the scores before Aaron Wildig capped a stunning turnaround moments later with the winner.
There was still time after that for the visitors to have a goal disallowed before the final whistle heralded Morecambe’s victory.
Preston North End boss provides injury update on Manchester United loanee and addresses specualtion linking them to another Red Devils youngster
Manchester United youngster being tested by Preston North End on a 'daily basis' after sparkling debut
The best fans photos from Preston North End's 4-1 win over Huddersfield Town in the Carabao Cup.
Wigan remain Championship relegation candidates but bookies' odds drift for Preston North End and Blackpool
Preston North End debutant talks making the step up, learning from Robbie Brady and Alvaro Fernandez and this only being the beginning
Derek Adams had kept faith with the same Morecambe starting XI which won at Barrow AFC at the weekend.
There was a change on the bench, however, as A-Jay Leitch-Smith was recalled in place of Morecambe’s Salford loanee Alex Denny.
Despite torrential rain before kick-off, the first half was an entertaining one with both sides keen to get on the front foot.
Salford saw Jordan Turnbull head a corner off target, while Robbie Gotts’ dipping effort from distance was comfortably held by Kyle Letheren.
At the other end, Shrimps’ full-back Liam Gibson fired over from 25 yards but they could have been ahead just past the half-hour.
Stockton and John O’Sullivan exchanged passes, sending the former bearing down on goal, but he took one touch too many and that allowed Turnbull to recover and block his attempt.
Mendes Gomes’ ball across goal was narrowly too far ahead of Stockton before the Ammies opened the scoring in first-half added time.
Moments after holding Ashley Hunter’s free-kick, Letheren was unable to keep out Thomas-Asante’s shot from the corner of the area.
Having emulated Salford by deploying three at the back, Morecambe suffered an early blow in the second half as Nat Knight-Percival limped off.
However, it was the visitors who enjoyed much the better of the early stages, though Jason Lowe blasted a shot out of the ground, Ibou Touray wasted a free-kick near to goal and Gotts had an effort blocked.
The Shrimps withstood that spell of pressure before bringing on Ryan Cooney in a bid to add some spark going forward.
Yann Songo’o shot wide from the edge of the area before Morecambe wasted a terrific opportunity on 81 minutes.
Capitalising on a Salford error, Mendes Gomes played in Stockton but he fired wide when one-on-one with the keeper.
Moments later and Mendes Gomes latched onto Wildig’s free-kick but sent his effort wide of goal.
Just as it seemed like the visitors would claim the spoils, a dramatic late finish ensued.
Mendes Gomes levelled in the 94th minute, forcing the ball home after Morecambe had hit the bar from a corner.
Moments later, Toumani Diagouraga shot from distance and Wildig diverted it home.
Astonishingly, Salford thought they had levelled within seconds, only for referee Scott Oldham to blow for a foul on Letheren and cap a crazy last few minutes.
Morecambe: Letheren, Mellor (Cooney 63), Lavelle, Knight-Percival (Hendrie 50), Gibson, Diagouraga, Songo’o, O’Sullivan, Wildig, Mendes Gomes, Stockton. Subs not used: Halstead, Slew, Lyons, Leitch-Smith, McAlinden.
Salford City: Hladky, Bernard, Eastham, Turnbull, Hunter (Threlkeld 84), Lowe, Coutts, Touray, Thomas-Asante, Gotts (Towell 63), Henderson (Wilson 74). Subs not used: Evans, James, Burgess, Dieseruvwe.
Referee: Scott Oldham.
Thanks for reading. If you value what we do and are able to support us, a digital subscription is just £1 per month for the first two months. Try us today by clicking here