Former Millers loanee Ian Henderson struck twice to put the relegation-battling hosts in charge before Matty Lund made it 3-0 in the 76th minute.
The visitors pulled a goal back late on through Jamie Lindsay but it was too little too late to prevent the second-placed Millers from suffering their first defeat in eight games.
An end-to-end first half closed with Dale one goal up, Henderson applying the finish to Aaron Morley's back-post delivery in the 27th minute when he dinked the ball inside Daniel Iversen's near post.
Rotherham had the ball in the net in the 35th minute when Ben Wiles, unmarked at the back post, headed goalward for what would have been the equaliser. However, his team-mate Michael Smith prodded the ball into the net from two yards and was duly flagged offside.
Dale doubled their lead in the 70th minutes when Lund cut open the Millers defence with a neat pass and Henderson netted his second.
And the home side underlined their superiority with a third goal six minutes later, Lund racing through onto a Callum Camps pass and lifting the ball over Iversen and into the unguarded net.
Lindsay struck for Rotherham in stoppage time, volleying home Wiles' delivery, but it was nothing more than a consolation.