Morecambe suffered their first defeat in five games at the New York Stadium.
Two goals in a minute in the second half gave the home side the victory after the Shrimps had taken a first-half lead.
Kevin Ellison fired Morecambe ahead on 29 minutes after a cool finish from a swift counter attack by the away side.
Jack Redshaw was the provider with a perfectly weighted through ball for Ellison who finished the move with a left-foot finish past Andy Warrington.
The Shrimps looked good value for the lead at the break with Redshaw close to adding a second but were undone by a quick brace from former Blackpool man Daniel Nardiello.
He was gifted his opener on 64 minutes when a Morecambe defensive clearance fell perfectly for him six yards out and he made no mistake to slot the ball past Barry Roche.
Within seconds the home side made it 2-1. Bob Harris crossed from the left and Nardiello slid in front of his marker to score from close range.
The Shrimps had one excellent chance to hit back but Stewart Drummond headed wide from a well-worked Andy Fleming corner when he should have done better.
Morecambe had to survive some early pressure with keeper Roche forced into excellent saves from Kari Arnason and Blackpool loanee Harris.
The Shrimps also survived a good penalty claim when Nick Fenton brought down Ian Sharps in the area but the referee waved play on.
Redshaw was a constant threat at the other end for Morecambe and he went close on 23 minutes when he was played in by Ellison but his final shot flew inches wide of the left-hand post with Warrington beaten.
Rotherham: Warrington, Tonge, Sharps, Morgan, Harris, Ainsworth, Arnason, Frecklington, Pringle (Agard 90), Revell, Nardiello (Odejayi 88). Subs not used: Thomson, Taylor, O’Connor, Evans, Bradley.
Morecambe: Roche, McCready (Reid 74), Fenton, Haining, Wright, Mustoe, Drummond, McDonald, Fleming, Ellison, Redshaw (Burrow 69), Alessandra. Subs not used: Arestidou, McGee, Doyle, Parkinson, Parrish.
Booked: Wright, Ellison
Referee: G Sutton