Millers boss Paul Warne named the same staring XI which were held 1-1 at Reading.
Rotherham - who had drawn their previous five games - started the day in the bottom three.
But they were in front in the second minute - 94 seconds on the clock - with the simplest of goals.
A long throw from Will Vaulks picked out Semi Ajayi, who headed inside David Raya's left-hand post.
Rotherham's long throws were causing Rovers early problems, and when the ball found its way back to Vaulks, he dragged his effort wide.
Millers goalkeeper Marek Rodak collected Jack Rodwell's overhead kick with ease, as the hosts negotiated the opening 20 minutes without trouble.
Blackburn enjoyed more of the game as half-time approached, but some resolute defending kept the visitors out.
Charlie Mulgrew came close to an equaliser in the 48th minute, but his corner somehow went across Rodak's goal.
But two minutes later Blackburn were level. Mulgrew's free-kick caused Rotherham problems, and Amari'i Bell netted.
Rotherham needed a response, and it came from substitute Ryan Williams.
A header from Michael Smith at the far post looked like Raya's ball, but in nipped Williams to poke home on 57 minutes.
Bradley Dack twice fired wide and the Blackburn No 23 was at the centre of everything the visitors were doing, Michael Ihiekwe doing well to deny Dack from close range at the expense of a corner.
Joe Rothwell resorted to shooting from long distance as Rotherham continued to frustrate the visitors with some dogged defending.
And the Millers grabbed a third goal seven minutes from time, and once again it was Vaulks setting up Ajayi.
This time Vaulks got the ball back after his long throw was not cleared, and his cross was arrowed into the top corner by Ajayi's head.
"We are staying" chanted the Millers support, as Rovers supporters headed for the exits.
Mulgrew pulled a goal back from the penalty spot - in five minutes of stoppage time - after Danny Graham was fouled in a goalmouth scramble, but Rotherham held out for a deserved victory.