Two goals from Daniel Nardiello helped Rotherham come from behind to beat Accrington and go fourth in League Two.
The hosts took an early lead when Dean Winnard headed in from Charlie Barnett's corner but Stanley's lead only lasted three minutes.
Winnard's misjudged header, following a long ball from Ian Sharps, went past home keeper Ian Dunbavin and Nardiello had an easy task to tap in for 1-1.
Nardiello scored a fortunate winner as his left-wing cross deceived Dunbavin.
The striker has now scored 10 times this season with five goals coming in his last four appearances.
Rotherham's victory takes them to within one point of the automatic promotion places, while Accrington remain 14th.
VIEWS FROM THE DRESSING ROOM
Accrington manager Leam Richardson told BBC Radio Lancashire:
"Sometimes you've got to hold your hand up. We didn't play well on the night.
"In patches we were good, but we didn't offer as big a threat as I would have like.
"Two mistakes has given them two goals. The lads are down and that's testament to them because they think they should win and that shows how far we've come."
Rotherham United manager Steve Evans told BBC Radio Sheffield:
"I was happy with the second half but in the first we stood off them a little bit.
"We spoke about stepping up the quality, passing it quicker and moving it quicker.
"It's a tough place to come. This is arguably the best Accrington side in years."