592892 Disclosed is a method and apparatus for milking a group of dairy animals (A, B) which is divided into at least two subgroups (A, B) such that a first subgroup (A) comprises dairy animals which give a first type of milk and a second subgroup (B) comprises dairy animals which give a second type of milk. The milking system (2) has to be flushed by a flushing device (11) after a dairy animal from the second subgroup (B) has been milked and before a dairy animal from the first subgroup (A) is milked. The milking system (2) milks the dairy animal after an identification system (10) identifies a dairy animal which presents itself for milking. A control device (12) decides whether the dairy animal presenting itself is to be milked and actuates the milking system (2) in order to milk a dairy animal if desired, and activates the flushing device (11) after the milking of a dairy animal from the second subgroup (B). The control device (12) is further configured to postpone the activation of the flushing device (11) until a subsequent dairy animal belonging to the first subgroup (A) has been identified and the decision has been made that the dairy animal from the first subgroup (A) presenting itself can be milked.