The Shrimps produced one of their best displays in recent seasons to beat a team who had not lost at home in League Two this campaign and moved up to fifth in the table in the process.
Boss Derek Adams made one change to the side that started in the midweek win over Leyton Orient with Stephen Hendrie coming back into the side due to an injury to Kelvin Mellor which saw Ryan Cooney switch to right-back.
Morecambe started the game on the front foot and took the game to the home side.
The best fans photos from Preston North End's 4-1 win over Huddersfield Town in the Carabao Cup.
Player Ratings: Huddersfield Town 1-4 Preston North End - Carabao Cup win on the road
Match Report: Huddersfield Town 1-4 Preston North End - PNE turn on the style in the Carabao Cup
Tottenham Hotspur loanee impresses Preston North End boss as plan comes together in Carabao Cup demolition of Huddersfield Town
A performance that Preston North End should back up -Tom Sandells' verdict after Carabao Cup win at Huddersfield Town
They were rewarded with an early goal when John O’Sullivan produced one of the strikes of the season so far.
An Aaron Wildig corner was headed clear by Noah Chilvers but it fell nicely for the Shrimps’ wide man to unleash a right-foot volley that flew through a crowd of players to beat home keeper Dean Gerken.
Morecambe continued to threaten with Yann Songo’o forcing a sharp save from Gerken with a close-range header and Cole Stockton firing into the side netting.
Carlos Mendes-Gomes was then denied by a smart save from the home keeper after he had only parried an effort from Stockton but reacted quickly to tip the follow-up on to the post.
The game saw the Shrimps play in front of a crowd for the first time this season and the Colchester fans had little to cheer until they levelled with a scrappy goal against the run of play on 23 minutes.
Cohen Bramall delivered a dangerous free-kick from the left-hand side that ended up in the back of the Morecambe net off Shrimps striker Stockton, although home striker Michael Folivi was the man originally credited with the goal.
After all their dominance the goal was a blow for the Shrimp but they maintained their pressure with Adam Phillips firing wide Mendes-Gomes going close again before the half-time break.
There was a further blow for the Shrimps when Phillips had to be replaced at the break after pulling up in first-half injury time but his replacement, Toumani Diagouraga, was pivotal to a fine second half.
He was soon in the thick of the action and played in Stockton who ran through on goal only tore denied by the foot of the left hand post.
Stockton was then denied a goal when he header from a Hendrie cross was superbly saved by Gerken and when Diagourage hit the crossbar with another header soon afterwards, many could have felt that this was not going to be Morecambe’s day.
But the Shrimps kept going and scored a deserved second on 62 minutes.
Wildig’s near-post corner was flicked on by Diagouraga and Songo’o was free at the far post to score his second goal of the season from close range.
The home side hit back as they looked to maintain their unbeaten home record and Mark Halstead was forced to make a fine save from a Kwame Poku cross come shot that was tipped over by the Shrimps’ keeper.
Halstead had to be at his best again in the latter stages as he tipped away a long-range effort from Folivi that was heading for the top corner and then saved from Ben Stevenson.
In the final seconds of injury time central defender Tom Eastman was left in space on the right-hand side of the area but dragged his shot wide as the Shrimps held on for a deserved three points.
Colchester: Gerken, Tchamadeu (Welch-Hayes 60), Eastman, Smith, Bramall, Chilvers (Gambin 66). Stevenson, Harriott (Poku 60), Folivi, Senior, Brown (Norris 60). Subs (not used): George, Sowunmi, Clampin.
Morecambe: Halstead, Cooney, Lavelle, Davis, Hendrie, Songo’o, O’Sullivan (Kenyon 90), Wildig (Gibson 90), Phillips (Diagouraga 46), Mendes-Gomes, Stockton. Subs not used: Turner, Leitch-Smith, McAlinden, Knight-Percival.
Referee: S Allison.