Three goals in 15 second-half minutes saw Morecambe momentarily forget about their off-field distractions and progress to the next round of the Checkatrade Trophy.
Needing victory to join Bradford in progressing from the group stages, the Shrimps trailed early in the second half to Harris Vuckic’s clinical finish.
However, Paul Mullin quickly brought the home side back on terms before two goals in three minutes from Cole Stockton put daylight between the teams.
Vuckic set up a nervy finish when he curled home a free-kick on 83 minutes but Morecambe held out to earn victory.
Shrimps’ boss Jim Bentley had made a number of changes from the side which began Sunday’s FA Cup tie with Coventry City.
Danijel Nizic, Liam Wakefield, Ryan Edwards, Luke Conlan, Andy Fleming and Jack Dunn were all named in the starting XI.
It was the home side which was first to have an effort at goal with Lee Molyneux’s early sighter pushed behind by City keeper Rouven Sattelmaier.
A more routine save from Fleming followed and Stockton headed off target as Morecambe had the clearer of the first-half opportunities.
Although Bradford grew into the game as the half progressed and had more of the possession, they failed to force Nizic into serious action.
Vuckic, Marc McNulty and Filipe Morais were all off target, while James Meredith had an effort blocked as an increasingly scrappy first half ended goalless.
Having introduced Mullin and Michael Rose at half-time, the hosts saw the latter have an early effort before City drew first blood on 52 minutes.
Morecambe’s defence failed to deal with a cross from the right and Vuckic controlled the ball well before firing beyond Nizic.
That lead lasted only two minutes, however, before Mullin capitalised on some indifferent defending to slot home from an increasingly tight angle.
Midway through the half and the Shrimps were in front; Dunn was set free on the counter-attack and he squared for Stockton to finish.
It was quickly 3-1 as Stockton turned on the edge of the area and his shot took a wicked deflection to wrongfoot Sattelmaier.
Mullin and Stockton both tested the City keeper but Bradford set a few hearts fluttering seven minutes from time.
Rhys Turner’s error ended with Bradford gaining a free-kick 20 yards out which Vuckic bent past Nizic.
Despite four minutes of added times - and some palpable nerves among some home fans - the Shrimps held out for a hard-fought victory.
Morecambe: Nizic, Wakefield, Edwards, Whitmore, Conlan, McGowan, Murphy (Rose 46), Fleming, Molyneux (Mullin 46), Dunn (Turner 77), Stockton. Subs: Roche, Winnard, Wildig, Massanka.
Bradford City: Sattelmaier, Windle, Clarke, McArdle, Meredith (Wright 69), Morais, King, Devine, Hudson (Rabiega 76), Vuckic, McNulty. Subs: Cracknell, Webb-Foster, Boateng.
Referee: Tony Harrington.