Morecambe kicked off the new year with their third defeat in four games over the festive period.
The only goal of the game came on 29 minutes after a moment of shocking defending.
Chris McCready’s poor clearance gave York a corner and they took full advantage as Michael Coulson swung in the dead ball to the far post, it was headed downwards and Ryan Jarvis was sharper than any Morecambe defender to volley past Barry Roche from six yards out.
The goal came just as the Shrimps were enjoying a period on top. Unfortunately they found themselves up against a goalkeeper in inspired form with Michael Ingham making a string of fine saves.
His best came from a curling Tony Diagne free-kick that was heading for the top right hand corner but he also reacted superbly to tip away a low drive from Andy Fleming.
Ingham was at his best again 10 minutes from time with another superb save as Jack Redshaw’s header from Padraig Amond’s left-wing cross looked destined for the bottom left hand corner of the York goal.
But for all Morecambe’s pressure York had chances to add to their advantage themselves. Lanre Oyebanjo missed from close range just seconds after the restart and Wes Fletcher shot straight at Roche when he was played in behind the Morecambe defence.
The Shrimps ended the game on the front foot but failed to threaten the York goal as the home side claimed a rare win.
Morecambe: Roche, McCready (McGowan 76), Doyle, Hughes, Parrish, Fleming, Drummond, Diagne, Mwasile (Redshaw 58), Sampson (Amond 69), Ellison. Subs not used: Threlfall, Kenyon, McGee, Arestidou.
York City: Ingham, O’Neill, Lowe, McGurk, Davies, Oyebanjo (Carson 84), Coulson, Platt, Montrose, Fletcher, Jarvis (Bowman 62). Subs not used: Chambers, Fyfield, Brobbel, Puri, Whitehouse.
Referee: N Miller.
Attendance: 3,276 (214 Morecambe)