Harvey Gilmour’s 89th minute goal settled a breathless, incident-packed afternoon at the Globe Arena.
With Morecambe having led and then come back from two goals adrift to level, they were caught by one final attack which saw the visitors claim three points.
It was just a shame that the match was somewhat marred by a post-match melee involving both sets of players and some of the respective coaching teams – and that was before referee Trevor Kettle and his assistants departed the scene of some highly questionable decisions.
The Shrimps had made three changes from the side which drew at Cheltenham Town on Tuesday.
Steve Old (Achilles) was ruled out, while Lamin Jagne and Jordan Cranston were both relegated to the bench with Aaron Wildig, Andrew Tutte and Rhys Oates back in the starting XI.
Tranmere had gone into the game with only one defeat in their previous eight matches and they came close to a dream start.
Oliver Banks’ ball to former Shrimp Paul Mullin allowed him to turn away from Sam Lavelle but his close-range effort was well saved by Barry Roche.
That set the tone for a frenetic 90-plus minutes with plenty of good football on show from both teams.
Nowhere was that more obvious than the move which gave Morecambe a 13th minute lead.
Intricate passing out of defence allowed Oates to run from deep at the Tranmere defence and, after twisting one way and another, he fired past Scott Davies from 20 yards.
A-Jay Leitch-Smith had a shot well blocked before the visitors drew level with the half-hour approaching.
Luke Conlan was deemed to have fouled Jonny Smith by the touchline and Gilmour’s free-kick was headed in by Banks.
If Morecambe were unhappy at losing their lead, they were livid moments later when a penalty appeal was waved away despite Banks clearly handling the ball.
Adding to their sense of injustice, the Shrimps fell behind four minutes before half-time when Zoumana Bakayogo got down the left and his cross was headed in by a diving Gilmour.
The second period continued in the same manner with Roche denying Mullin and play immediately switching to the other end where Davies kept out Vadaine Oliver’s shot.
Roche denied Connor Jennings moments later, seconds before Tranmere took a two-goal lead on 54 minutes.
Liam Mandeville seemed to be fouled, only for the officials to wave play on and Tranmere countered with the outstanding Smith cutting in from the right and curling a shot past Roche.
Banks saw a shot deflected narrowly wide and then fired wastefully off target when well placed as Rovers scented a fourth.
However, Morecambe found renewed impetus with Davies making a fine low save from Leitch-Smith and then keeping out Mandeville’s cross.
The pressure paid off with 18 minutes remaining when Zak Mills crossed and Oliver headed home from inside the six-yard box.
Eight minutes later and the scores were level when a free-kick ended with Leitch-Smith glancing home Tutte’s free-kick.
There was still time, however, for one final twist as Bakayogo and Gilmour linked up again, the full-back getting behind Mills and laying the ball back for the midfielder to settle a dramatic day.
Morecambe: Roche, Mills, Yarney, Lavelle, Conlan, Wildig (Piggott 90), Tutte, Mandeville, Leitch-Smith, Oates (Ellison 77), Oliver (Oswell 86). Subs not used: Halstead, Jagne, Cranston, Hedley.
Tranmere Rovers: Davies, Buxton, McNulty, Monthe, Bakayogo, McCullough, Gilmour, Banks, Jennings 90 (Ellis 90), Mullin (Akammadu 83), Smith (Mottley-Henry 77). Subs not used: Wharton, Tollitt, Caprice, Cole.
Referee: Trevor Kettle.