A method of automatically milking a dairy animal, in particular a cow. The method comprises: a) the step of activating the teat cup for milking the teat b) the step of measuring a milking parameter during milking the teat during step a) for obtaining a value of the milking parameter, and c) the step of deactivating the teat cup when a deactivation threshold has been reached. The deactivation threshold is determined at least partially with the aid of the value of the milking parameter. A device for automatically milking a dairy animal, in particular a cow. Said device is provided with means for activating the teat cup for milking a teat of the dairy animal, means comprising a milking parameter for measuring a milking parameter during milking the teat for obtaining a value of the milking parameter, means for deactivating the teat cup, and means for generating a threshold signal indicating that a deactivation threshold has been reached. The deactivation means are put into operation with the aid of the threshold signal, the means for generating the signal indicating a deactivation threshold generating the signal at least partially with the aid of the value of the milking parameter.