A milking system for milking animals comprises a common milk line (4) connected to a milk storage tank (7), at least two milking stations (la, lb, lc) connected to the common milk line (4), and a computer (9) for storing milk quality information and animal identity data. Each milking station is adapted to automatically identify an animal, to automatically extract milk from the animal, and to automatically transfer the milk in the common milk line from the milking station to the milk storage tank. A milk constituent analyzing unit (5) is arranged to analyze milk from the common milk line (4) with respect to a specific constituent, wherein the milking stations (la-c), the computer (9), and the milk constituent analyzing unit (5) are communicatively connected, thereby allowing the result of the analysis of the milk with respect to the specific constituent to be associated with the identity of the animal or the identities of the animals, from which the milk was extracted.