Billy Clarke’s winner consigned Steve Davis’ men to defeat but with Notts County, Crawley and Leyton Orient all unable to win elsewhere, Alex booked another stint in the third tier.
The hosts were served a warning when Christopher Routis’ sweetly-struck half volley flew over the crossbar after 22 minutes and one minute later they were behind.
Tony McMahon’s free-kick from the left was not cleared and the ball fell to Clarke, who swivelled before drilling a clinical finish into the far corner of Paul Rachubka’s net.
Davis’ men almost hit back instantly, yet the angle was always against Lauri Dalla Valle as he skewed wide, while the Finn was hesitant moments later in a one-on-one situation, allowing Rory McArdle to make a brilliant sliding intervention.
At the other end, James Hanson should really have doubled the Bantams’ advantage before the break but he scooped the ball over from close range after being teed-up by Jon Stead.
After the break, Alex thought they were level when Harry Davis’ long free-kick came through to Jon Guthrie, but Ben Williams made himself big to brilliantly thwart the defender at point-blank range.
Stead almost punished an Anthony Grant error with a rising effort which Rachubka pushed over the top.
Colchester’s 82nd-minute goal against Preston sent Crewe back into the relegation zone and Jamie Ness was unable to lift them out of it with a 25-yard effort which sailed over.
But two late Gillingham goals against Notts County ensured their safety and so while Ryan Colclough was denied a late penalty after claiming he’d been tripped by McArdle, the Alex staved off relegation thanks to results elsewhere.