Lewis Grabban struck in injury time to beat Morecambe and hand Steve Evans his first win as Rotherham boss.
Grabban opened the scoring with a fierce drive that tore the netting in the top corner, before Jordan Burrow equalised after some poor defending.
Jason Taylor restored the Millers' lead from the edge of the area, before Ryan Cresswell brought down Danny Carlton in the box and received a second booking.
Jack Redshaw levelled from the spot, but Grabban rifled in from 30 yards.
VIEWS FROM THE DRESSING ROOM
Rotherham United manager Steve Evans tells BBC Radio Sheffield:
"We're highly delighted, the disappointing thing was at half time to go in at 1-1.
"I said to the boys that I was disappointed with the quality in the final third and we had to work a little bit harder.
"I think we did that in the second half with ten (men).
"But I think we missed a big chance at 2-1 to go 3-1 and if that had happened it maybe would have been a four or five scoreline."
Morecambe manager Jim Bentley told BBC Radio Lancashire:
"I'm fuming with the lads and I'm sick of saying the same thing.
"We've been beaten by the odd goal in a game that we should have taken something from.
"We lacked a little bit of know-how today and, in the second half, we were a little bit off it.
"If we're going to improve, we need one or two more leaders that will make sure you don't lose games like that."