A Garry Thompson header eight minutes from time saw Morecambe clinch a place in the next round of the GLS Conference Cup.
Thompson finally ended Scarborough's resistance with a well taken goal from a Lee Elam cross in the closing stages of a game the Shrimps dominated but were often thwarted by young goalkeeper Peter Keen who made some fine saves.
In the first half Keen reacted sharply to save from Michael Twiss and did well to tip over a long range shot from Garry Hunter before the best save of the half, a great block from Jim Bentley's close range header.
He could do nothing to prevent the Shrimps from taking the lead on 26 minutes however.
Twiss's run into the box was ended by a clumsy Colin Cryan challenge and the Shrimps' top scorer made no mistake from the spot.
Unfortunately the lead lasted just four minutes as Morecambe gave away a penalty themselves with another awful challenge.
Iain Swan was the culprit as he wrestled the speedy Keith Gilroy to the ground and Tony Hackworth scored from the spot kick.
Jim Harvey's side continued to push forward with Hunter's flick header creeping just wide of the right hand post and Wayne Curtis and Thompson drilling shots from distance just over the bar.
The second half began with Twiss volleying an Elam cross wide before the game hit something of a sterile patch.
Thankfully Morecambe dug deep and gained the upper hand again. Keen saved superbly from Curtis's sweetly struck drive and did well to hold on to a Twiss drive.
Bentley then came close with a header that grazed the crossbar before Thompson beat Keen with a well placed header.
After failing to threaten Adam Sollitt's goal in the second half Scarborough threw bodies forward for a late flurry and almost forced extra time when a 90th minute Cryan effort was cleared off the line by substitute Jimmy Kelly who was making his first team debut after beingt injured in pre-season.
MORECAMBE: Sollitt 6, Howard 6 (Kelly 24, 6), Blackburn 6, Swan 6 (Ruffer 76, 6), Bentley 7, Elam 7, Curtis 7, Twiss 6, Hunter 6, Walmsley 6, Thompson 6 (Carlton 90). Subs not used: Robinson, Dodgson.
Scorers: Twiss 26pen, Thompson 82
SCARBOROUGH: Keen 9, Heinemman 6, Gilroy 7 (Senior 82), Kerr 6, Pounder 6, Lyth 6, Baker 6, Cryan 6, Hackworth 6, Bishop 6, Coulson 6 (Warwick 72). Subs (not used): Thompson, Beadle, Walker.
scorer: Hackworth 30pen
Referee: Mr C Harwood .
Starman: Lee Elam.
* Morecambe will be at home to Carlisle United in the next round.