Rotherham were stunned by two first half goals in a minute from Matt Ritchie. The first came after 19 minutes when Callum Kennedy's high ball into the area was only headed clear as far as Ritchie, who thrashed home a superb left-footed volley.
Less less that a minute later Ritchie did it again. From almost the identical spot the midfielder hit a powerful drive that took a deflection off a defender and wide of Rhys Taylor's despairing dive.
Millers striker Alex Revell headed just wide from Sam Wood's corner shortly after the restart, but was on hand to reduce the arrears after 53 minutes.
Chris Holroyd chased a lost cause down the left but got his cross in before clattering into the advert boards and Revell out-jumped everyone to head home.
And Rotherham came within a whisker of an equaliser after 73 minutes when Lewis Grabban slammed a shot against the upright from Wood's corner.