Stockport County came from behind to end South Shields’ involvement in this season’s Emirates FA Cup.
The Mariners were on course to beat the National League North side when Carl Finnigan gave them the lead just after the half-hour mark.
But Stockport took the ascendancy as the game went on, equalising before half-time and creating a number of chances in the second half.
They got their reward in stoppage time when substitute Nyal Bell hooked in the winner from a left-wing free-kick.
Shields suffered a blow in the lead-up to the game when in-form forward Josh Gillies was ruled out with an ankle injury picked up in training.
Lee Picton and Graham Fenton opted to bring in Darren Lough, who slotted in at left-back while Blair Adams was moved to the right side of midfield.
Although the Mariners were not at their free-flowing best in the first half, they did produce some excellent moments and deserved the lead Finnigan gave them.
They had been patient in the early stages, with Finnigan and Gavin Cogdon leading from the front.
Finnigan repeatedly pressed his opponents into mistakes, one of which came when he charged down a clearance from Stockport goalkeeper Ben Hinchliffe.
The ball bounced to safety but Cogdon eventually took control of it before dragging a shot wide from 20 yards.
In a similar passage of play, Finnigan won the ball high up the pitch soon after before beating his defender with good strength and having an effort deflected over.
That offered great encouragement for a vocal home support, with Liam Connell untroubled by a handful of attempts at the other end.
Shields maintained overall control and opened the scoring in the 31st minute.
Robert Briggs curled in a corner from the left which was taken from the head of Dillon Morse by a defender. Phil Turnbull chased the loose ball and kept it in play and Shields probed before Cogdon intelligently played in Adams on the inside-right of the box and he drilled it across the face of goal for Finnigan to tap home. It was a well-worked goal to give Shields the lead they deserved.
Soon after, though, the hosts were dealt a major blow when Cogdon – who had enjoyed an excellent start to the game – suffered a hamstring injury.
His replacement, Ursene Mouanda, produced a fine performance which was enough to earn him the man of the match award from sponsors Aztec Colour Print, but Shields undoubtedly missed Cogdon.
Immediately after he was withdrawn, Stockport equalised as a corner from the left by Adam Thomas bounced in the Shields area and, as time appeared to stand still, Sam Walker flicked it beyond a sea of bodies and into the net.
The Mariners were stung but avoided a double concession when an effort from 20 yards by Connor Dimaio cleared the crossbar.
Finnigan had two decent chances as the first half drew to a close, but on both occasions Hinchliffe closed the angle well and snuffed out the opportunity.
Shields were positive at the start of the second half and quickly had an opening when Craig Baxter’s cross from the right found David Foley at the back post, but Hinchliffe was again quickly out before pushing Foley’s shot to safety.
Jon Shaw later headed wide from a Briggs corner, but Stockport started to gain control after the hour mark and succeeded in pushing the home side back.
Darren Stephenson was one of their main threats, and he forced Connell into a decent low save before hitting another shot wide from 10 yards.
The pressure started to build but Connell would not be beaten. Frank Mulhern was played in on the inside-right of the box, but Connell beat his effort out for a corner. Baxter produced a fine interception just as Ash Palmer seemed set to score soon after, while substitute Elliott Osbourne closed down a Connell clearance and Shields were fortunate to see the ball bounce wide.
Connell also palmed a further effort from Osbourne to safety, but the best chance of the lot fell the way of substitute Nyal Bell after a corner fell to his feet 10 yards out. Shields breathed a sigh of relief when he blazed his volley over.
The Mariners appeared to have made it through their rocky spell and had some attempts of their own, albeit from distance.
An audacious 45-yard effort from Foley went wide while Mouanda hit one from distance which Hinchliffe comfortably stopped.
The decisive moment came just as the tie appeared to be heading for a replay when Stockport were awarded a free-kick on the left flank a minute into stoppage time.
Walker curled it in and Bell hooked the ball powerfully past Connell to bring Shields’ involvement in the Emirates FA Cup to an end at the second qualifying round stage.
SOUTH SHIELDS: Connell, Baxter, Lough (Mason 52), Shaw (c), Morse, Turnbull, Adams, Briggs (Wright 74), Cogdon (Mouanda 36), Finnigan, Foley. Subs not used: Lister, Brown, Hunter.
Goal: Finnigan (31).
WORDS: Daniel Prince. IMAGE: Peter Talbot.