David Syers scored a last-minute winner for Doncaster Rovers at Oldham.
The substitute headed home from Tommy Spurr's cross to give the promotion hopefuls a first win in five matches.
Rovers took an early lead through Rob Jones after Billy Paynter's flick from a David Cotterill free-kick had come back off the post.
Youssouff M'Changama levelled for the Latics when his effort from 25 yards slipped through the grasp of visiting keeper Gary Woods.
VIEW FROM THE DRESSING ROOM
Doncaster boss Dean Saunders told BBC Radio Sheffield:
"The conditions spoiled the game really. It was a battle out there and a bit of a scrappy game.
"I suppose it could have gone either way but we got on top of them in the second half. We couldn't find the finishing touch to the chances we created.
"We're getting results and that's all that matters.
"I've got to gradually build the team and keep getting better and better."