The invention relates to a device for and method of milking dairy animals, in particular cows. The device and method have been improved in order to enhance the efficiency of use. In one embodiment, for the milking, teat cups (2) are connected by means of a robot arm to respective teats of the dairy animal. This makes it possible to start the milking of the teats of the dairy animal. A milk flow from the respective teat can be measured. The milking can be ended by means of a control unit (13) in dependence on a comparison value which is calculated on the basis of a milking parameter representative of a milk flow from the respective teat and in dependence on a deactivation threshold. According to the invention, the milking of the last teat is ended in dependence on a last-teat period to be calculated.