Three first half goals proved enough for Cardiff City as they inflicted the Millers first home defeat since January at the AESSEAL New York Stadium.
Rotherham started the game brightly and had early chances to score through Danny Ward and Matt Derbyshire. But the game turned midway through the first half as City scored twice in three minutes through Bruno Ecuele Manga and Federico Macheda to lead 2-0.
The goals seemed to sap the Millers confidence and the Bluebirds scored a third just before half time when Conor McAleny found space in the box and found the back of the net.
The second period turned into a scrappy affair, with neither side creating much. But the Millers eventually found a consolation goal when Ward was picked out in the box and he nodded home.
Following victory against Millwall at the weekend, manager Steve Evans named the same starting 11 to take on the Bluebirds.
Rotherham had the chance to score within the opening 30 seconds. A lack of communication in the Cardiff defence saw Ward almost got on the end of a poor back pass, but the ball just escaped his reach.
The Millers fast start continued when a long throw from Kari Arnason eventually found Conor Newton on the edge of the box. The midfielder hit a fierce volley towards goal but his effort was bravely blocked by Aron Gunnarsson.
The home side continued to dominate proceedings and thought they had taken the lead after 9 minutes. After some neat build up play Ward's cross found Derbyshire in the box who poked the ball into the back of the net. However, the linesman had his flag up to rule the goal out for offside.
Just past the quarter hour mark Rotherham continued to press and earned a corner after good play on the right wing by Derbyshire. Ben Pringle delivered a delicious ball into the box but the former Nottingham Forest forward could only nod the ball wide.
Midway through the first half Cardiff began to grow into the game. After 23 minutes the Bluebirds earned their first corner of the game and they made it count. The ball was whipped in by Joe Ralls and defender Ecuele Manga rose the highest in the centre of the box to head the Bluebirds into the lead.
The goal seemed to give City confidence and they doubled their lead just three minutes later. The ball was lifted towards the edge of the Millers penalty area and Macheda beat the offside trap and the Italian allowed the ball to drop over his shoulder before showing excellent technique to drive his volley low past Adam Collin.
Rotherham pressed to get back into the game immediately though and came close to clawing one back when Pringle attempted to beat David Marshall from long range, only to see his low shot deflected over the crossbar.
Cardiff wasted no time in netting again and with the ball bobbling around in the box the defence panicked and failed to clear their lines before it eventually dropped to McAleny who was in acres of space to put the ball into the top corner and put the Bluebirds 3-0 up after just 35 minutes.
Just before half time the Millers fought to get back into the game. Ward accelerated past defender Sean Morrison and won his team a corner, but Pringle's centre was well dealt with by the Cardiff defence.
In added time the Bluebird thought they had added a fourth. Matthew Kennedy was allowed to run all the way from his own half before eventually finding Macheda. The former Manchester United striker put the ball beyond Collin, but to the Millers relief the linesman had his flag up.
Half-time:- Rotherham United 0-3 Cardiff City
When the teams returned from the break there was a change in personnel for both sides. Newton was replaced by Adam Hammill for the Millers while there was a change in goal for Cardiff as Simon Moore replaced Marshall.
After a slow opening five minutes of the second half the Millers finally got their first opportunity to score when Pringle swung in a free kick which was eventually dealt with by the Cardiff defence.
The Millers continued to press for a goal and Pringle again crossed delightfully but Ward's header was deflected just wide.
Former Rotherham striker Alex Revell then tested his own goalkeeper after a long throw from Arnason went into the box and Revell flicked it goalwards, but Moore was on hand to catch with ease.
As the half wore on the Millers became more frustrated and could have gone four behind. Cardiff substitute Eoin Doyle slipped the ball through to McAleny who was one on one with Collin, but the strike was tame and Collin saved with his feet before also saving the follow up shot from Revell.
With 15 minutes to play the Millers had their first chance of note in the second half when Pringle fired the ball across the box and found Ward who's shot was deflected wide. From the resulting corner the ball eventually fell to Hammill on the right hand side of the box and the winger hit a left footed effort which was saved by Moore.
But the Millers did evenutally find a reply. Hammill crossed the ball from the right hand side and found Ward free in centre of the box and the forward headed the ball into the far left of Moore's goal to give Rotherham a late lifeline.
Rotherham continued to push and almost scored again when Zeki Fryers cross was spilled by Moore and fell to Paul Green. However, just as Green was about to put the ball into the net the referee blew for a foul on the goal keeper.
But Rotherham failed to create any more chances and Cardiff held out to take all three points and leave the Millers to lick their wounds following their first home defeat since January.
Full-time:- Rotherham United 1-3 Cardiff City
Teams:- Rotherham: Collin, Arnason, Broadfoot, Green, Newton (Hammill 45), Pringle, Ward, Derbyshire (Sammon 59), Fryers, Hunt, Smallwood. Unused:- Frecklington, Milsom, Richardson, Clarke-Harris, Thompson
Cardiff City: Marshall (Moore 45), Peltier, Ecuele Manga, Macheda (Doyle 70), McAleny, Connolly, Gunnarsson, Ralls, Revell (Jones 85), Kennedy, Morrison Unused:- Fabio, Noone, O'Keefe, Harris
Attendance:- 8,534 (396)