Reported by Mark Perrow at HillsboroughCity came from behind twice to claim a priceless victory at the home of fellow strugglers Sheffield Wednesday.
Miguel Llera’s header set the hosts on their way inside three minutes, before Sam Baldock equalised with the first of two penalties.
But with City pressing for a late winner, Gary Madine capitalised on an error from Tom Heaton to edge Wednesday back in front on 78 minutes.
However, the drama was far from over as Madine immediately handled in his own area, allowing Baldock to bury his second spot-kick of the day, before Albert Adomah won it with a superb free kick four minutes from time.
There was still time for Madine to appear to snatch a point, but an apparent infringement from Llera in the build-up was sufficient to see the strike ruled out, and City held on.
Derek McInnes made two changes to his side beaten so convincingly by Wolves at Ashton Gate last time out, with Stephen McManus making a surprise recovery from injury to partner former Middlesbrough sparring partner Matthew Bates at the back.
Meanwhile, Baldock came in for his first start in four weeks up front alongside Ryan Taylor, with midfield pair Neil Kilkenny and Stephen Pearson dropping to the bench.
The hosts came into the game on a run of six straight defeats, but flew out of the blocks with real purpose, forcing an early corner when Bates had to turn the ball behind from his own six-yard line.
And from the resulting kick Wednesday took the lead, as Llera rose unchallenged to power home an inswinging delivery from former Bristol Rovers midfielder Chris Lines.
It was a nightmare start for City in a real six-pointer at the bottom of the npower Championship table, and a deficit that might easily have increased inside the opening ten minutes.
First Llera, a defender by trade, rifled a 30-yard free kick straight down the throat of Heaton, before Madine shot tamely into the arms of the City keeper from a position demanding more.
Still in the game’s embryonic exchanges, Jermaine Johnson tore past left-back Liam Fontaine and into the penalty area to pick out Chris O’Grady, only for the striker to lose his balance and skew his shot high and wide from 12 yards.
But with City fortunate to only be one down, they were gifted an opening to draw level when Llera brought down Baldock in the box on 17 minutes.
There seemed no obvious danger when Adomah fed the ball into the feet of the diminutive striker, but Baldock was sharp and quickly turned his man, inviting the Spaniard to linger a lazy leg in his direction – down went Baldock leaving referee Andre Marriner with little option but to point to the spot.
City’s number seven duly dusted himself down and confidently tucked the ball low to Chris Kirkland’s left, putting the one-time England stopper the wrong way in front of the travelling fans.
The equaliser knocked the stuffing out of the home side and indeed a home crowd previously buoyant with what they were seeing.
All of a sudden high, speculative balls into the City box provided Wednesday’s only threat, while the Robins were beginning to contain and counter with purpose.
Fleet-footed winger Michail Antonio did inject some excitement into a first half gradually petering out, but was off target with his curling effort from the left corner of the penalty area.
But City responded after the interval with real intent. When Adomah’s shot was deflected behind for a corner, Neil Danns took the kick and played a cute low ball across the box for the onrushing Baldock to strike first time with power, but ultimately off target.
At the other end, Johnson’s driven cross awkwardly looped off the leg of McManus but thankfully over Heaton’s crossbar with the keeper taken out of the equation completely.
Slowly but surely, City had been building foundations throughout the contest, and more good work from Adomah threatened to provide a crucial second goal in their favour.
A trademark mazy run from the Ghanaian resulted in another corner, and after Wednesday failed to clear, he picked out Baldock to sting the palms of Kirkland.
Things were hotting up at Hillsborough, with neither team content to settle for a stalemate. Madine passed up a glorious chance after 56 minutes, sidefooting O’Grady’s square pass against the legs of Heaton as City breathed a collective sigh of relief.
A bout of aerial pressure was next on the agenda for the former Cardiff stopper, as Johnson’s dangerous cross was well intercepted by Richard Foster but dropped out of the sky almost vertically above Heaton’s crossbar.
With bodies piling in on him, the man kitted out in bright orange initially dropped the ball before reclaiming it in desperation when it finally laid to rest inside his six-yard box.
The game continued toing and froing, and City looked to be in business when Adomah exchanged passes with Foster and slipped his way to the byeline, before pulling the ball across but somehow out of reach of every onrushing red shirt.
Moments later, Baldock found space in almost identical fashion and picked out Fontaine in a perfect position, only for Kirkland to spread himself and keep out the defender’s flick towards goal from point-blank range.
City were pressing hard. Danns sent a dipping volley just over from distance, but all their good work in trying to snatch the lead was undone when Antonio led a Wednesday breakaway and rifled a shot towards goal.
When Heaton spilled it, Madine was on hand to tuck away the rebound and send Hillsborough into raptures.
It was rough justice on McInnes and co at the heart of the Robins’ best spell of the game, but the hosts’ elation was short-lived, as Madine turned from hero to villain with an innocuous handball inside his own area.
Baldock stepped up, unnerved by the antics of Llera in trying to put him off, and smashed the ball high into the roof of the net for his second successful spot-kick of the afternoon.
But the drama was far from over. When Danns was tripped four minutes from time, Adomah struck the killer blow with a delightful 25-yard free kick to spark jubilant scenes as the winger led his team-mates to embrace McInnes and the coaching staff in the technical area.
There was still time for Madine to think he had equalised at the death as controversy reigned in South Yorkshire, but Marriner saw wrongdoing in the build-up, ruled it out and City escaped with three vital points.