590422 The invention relates to a system (10) operable to automatically obtain a milk sample and to automatically perform cleaning. The system (10) comprises: a milking arrangement (12) adapted for the milking of animals (14) a milk conduit (38) a cleaning supply conduit (56) comprising a cleaning device (82) adapted to supply cleaning liquid to the milking location (16) teat cups (18) for each milking location (16), connected to said cleaning device (82) and said milk conduit (38) during the cleaning and a sampling arrangement. The sampling arrangement comprises: an intermediate sampling device (24) a diverting means (22) operable to divert milk from the teat cups (18) to the intermediate sampling device (24) and a milk sample collecting element (64) for the milking location (16), operable to obtain a milk sample from the intermediate sampling device (24). The system (10) is adapted to apply a suction pressure during the cleaning, in order to draw the cleaning liquid through both the milking arrangement (12) and the sampling arrangement.