The invention relates to a milking system and a method for preventing detachment of a teat cup from a teat of an animal during a milking process. The milking system comprises a milk line (lb, lc, 2) connected to the teat cup (1 a), a vacuum system able to apply at least two different vacuum levels to the teat cup (la) and a measuring device (4) configured to measure the air flow in the milk line (1 b, 1 c, 2) during the milking process. The milking system comprises a control unit (5) configured to receive information about measured air flow values and to determine if the teat cup (la) is about to be detached from the teat by comparing the measured air flow values (q