Posh moved into the play-off places thanks to goals from Ivan Toney and Sammie Szmodics, despite Michael Ihiekwe pulling a goal back for the visitors in an action-packed first half.
Rotherham's first league defeat since December 7 allowed Ipswich to claim top spot.
It took less than two minutes for Toney to bag his 20th goal in all competitions this season. Siriki Dembele nipped in ahead of Chiedozie Ogbene and charged down the left before picking out the striker at the back post.
The second goal came in the 22nd minute following a superb move which included a one-two between Dan Butler and Jack Taylor. The former then played it down the line to Szmodics who curled in.
Rotherham pulled one back 10 minutes before the break as an unmarked Ihiekwe volleyed in Daniel Barlaser's left-wing corner.
Toney and Rotherham's Michael Smith both had second-half headers well saved, while there was a seven-minute delay due to an injury to one of the linesmen, with a member of the crowd taking over fourth official duties after an appeal over the tannoy.