Accrington's left winger John Miles was instrumental, setting up both home goals for Jimmy Ryan and Terry Gornell and it looked like Miles would be the key to a Stanley win.
But Michael Boulding, substitute Barry Conlon and League Two's leading goalscorer Peter Thorne turned things around dramatically for City.
Midfielder Ryan struck home his third goal of the campaign, right-footed, from the edge of the area on 23 minutes. Miles had sent in a right-wing corner that was dummied by captain Peter Cavanagh.
Stanley striker Gornell latched on to a Miles through ball five minutes into the second period to slip the ball under Rhys Evans to double the lead. It was his first goal for the club.
Boulding began the comeback ten minutes from time, volleying home with ten minutes left, before Conlon, who came on with 31 minutes left, headed home a Paul McLaren free-kick on 87 minutes.
Thorne then tucked home Joe Colbeck's lay-off a minute later to complete what was a remarkable chain of events. The veteran former Blackburn and Stoke striker has now scored nine goals this season.
Accrington, whose players were left lying on the ground in disbelief at full-time, have now lost seven games in the last eight. Their home form is worrying to say the least.
Meanwhile, the Bantams, who began the game in the play-off places, are fast becoming genuine promotion contenders.