A method and arrangement are provided for controlling the milking by a milking machine, which comprises at least one teat cup (11) having a flexible teat receiving liner (13) arranged inside a teat cup shell (15), wherein, during milking, a vacuum is applied to a lower part (13a) of the interior of the flexible teat receiving liner to draw milk from a teat (17) received therein while the flexible teat receiving liner is periodically opened and collapsed by application of a pulsating massage vacuum between the flexible teat receiving liner and the teat cup shell. According to the invention a pressure sensor (21) measures repeatedly a vacuum level in an upper part (13b) of the interior of the flexible teat receiving line, and means (23) is provided for, depending on the repeatedly measured vacuum level, interrupting the periodic opening and collapsing of the flexible teat receiving liner by keeping the flexible teat receiving liner collapsed for a specific period of time.