Daniel Nardiello scored a brace to help Rotherham clinch victory against a 10-man Oldham.
He put the Millers ahead from the penalty spot, before David Mellor received a straight red card for a kick at Lee Frecklington.
Cristian Montano levelled almost immediately and Matteo Lanzoni's tap-in to put the visitors in front.
Frecklington equalised with a header before Nardiello slammed in the 90th-minute winner from six yards out.
VIEW FROM THE DRESSING ROOM
Rotherham United manager Steve Evans told BBC Radio Sheffield:
"Tremendous credit to my players.
"We were robbed of key players today, but the people that have come in have responded with a good performances.
"It was going to be tough and Oldham are a good side so we're pleased to get three points."