An animal hoof cleaning system that includes an automatic milking station, an automatic spraying device configured to clean at least one hoof of an animal housed in the automatic milking station by spraying a fluid towards the at least one hoof, a control unit that controls the operation of the automatic spraying device, and detecting means that detects a milking state wherein all the teats of the animal are enclosed in respective teat cups, where the control unit is configured to control the operation of the automatic spraying device on basis of information from the detecting means such that the automatic spraying device sprays on the hoof of the animal only when the detecting means detects the milking state.