The teams were locked at 2-2 when the visitors scored a remarkable goal direct from a free-kick just inside their own half. Gary Roberts spotted keeper Simon Eastwood off his line and scored with a superb shot that went into the net off the underside of the crossbar.
Rotherham goalkeeper Andy Warrington made two superb saves to preserve his side’s lead before Drewe Broughton put the result beyond doubt with Rotherham’s fourth goal.
Bradford had gone in front after 18 minutes when Simon Whaley’s free-kick rebounded off the Rotherham defensive wall for Lee Bullock to turn the ball past Warrington.
But Rotherham equalised after 31 minutes through Kevin Ellison, who then put the visitors 2-1 in front after 37 minutes from Adam Le Fondre’s pass.
Michael Flynn levelled the scores for Bradford 13 seconds after the restart from Scott Neilson’s pass to set up an exciting second half.