Ten-man Maidenhead squandered the chance for a famous FA Cup scalp after League One Rotherham fought back to win.
The National League outfit led for 44 minutes after Jake Cassidy's opener.
But Alan Massey's 54th-minute sending off allowed Paul Warne's side to canter into the second round.
Chiedozie Ogbene came close to breaking the deadlock for the visitors when he blasted wide.
Then, against the run of play, Cassidy kept his cool to calmly slot into the bottom corner.
The hosts defended well and keeper Chris Dunn produced a fine save to keep out Ben Wiles just before the break.
Massey left Maidenhead a man down when he was shown a straight red card for a reckless challenge on Wiles.
And the man advantage saw the Millers pile on the pressure.
Michael Ihiekwe levelled in the 69th minute with a fine finish.
And record summer signing Freddie Lapado put Rotherham in front when he blasted home with 15 minutes left.
With three minutes remaining, Rangers loanee Jake Hastie danced past the hosts' defence to find Matt Crooks - who scored his seventh goal in as many games.
It could have been more towards the end as Wiles' strike rattled the bar.