An injury-time penalty from Carl Baker gave Morecambe a deserved win at Chester.
The game looked destined to end goalless until Paul Linwood dragged down Matthew Blinkhorn in the second minute of stoppage time as the striker bore down on goal.
Premiership official Phil Dowd, on the advice of the assistant referee, promptly pointed to the spot and dismissed Linwood. Baker, who had been a thorn in Chester's side all night, stepped forward and sent keeper John Danby the wrong way to give the Shrimps all three points.
There was little to choose between the teams in an evenly fought first half.
The first opportunity fell Chester's way in the 25th minute when Kevin Ellison's low cross narrowly evaded Simon Yeo who was running in on goal.
Keeper Joe Lewis did well to thwart Yeo four minutes later, just beating him to the ball on the edge of the area. Chester began to turn up the heat, and John Murphy forced Lewis into a smart save from his 25-yard drive.
Lewis was again called into action seven minutes before half-time to deal with a header from Mark Hughes and then to deny Murphy once more following a big scramble in the box.
However, the closest either side came to a goal in the first half arrived after 40 minutes when Morecambe's Craig Stanley stabbed a shot which rolled agonisingly wide of the target with Danby beaten.
On the stroke of half-time Danby pulled off a stunning save to deny Baker's deflected drive from the edge of the box.
Morecambe began the second half as they ended the first, dominating possession for the opening ten minutes. Baker's fierce drive was parried by Danby on 52 minutes and swept clear as panic ensued in the home defence.
Just as Morecambe looked as if they were about to score, Ellison was presented with a golden opportunity for Chester on the hour mark when clean through, but he skewed his right-foot shot tamely wide.
It was a minor miracle that the game was still goalless at this point. On 67 minutes Baker really should have scored when he skilfully cut back inside with only the keeper to beat, but as time stood still he pulled his shot into the sidenetting.
Morecambe substitute Michael Twiss then contrived to miss from six yards out with a volley which flew over the bar.
City substitute Paul Rutherford then went on a scintillating run which ended with Ritchie Partridge firing over from just outside the box.
Chester had a good claim for a penalty late on when David Artell appeared to nudge Ellison as he homed in on goal but referee Dowd waved away the appeals.
There was still time for Chester substitute Kevin Roberts to drill a powerful shot onto the roof of the net with Lewis well beaten.