A device for milking animals including a plurality of milking stations, wherein each milking station includes a milk collecting container and a displacing mechanism for displacing liquid from the milk collecting container. The milk collecting container (is connected to a first discharge line and to a second discharge line, a second central milk line is connected to the second discharge line for leading milk from a plurality of milking stations to a collective liquid discharge and further includes a line cleaning device connected to the second central milk line for cleaning at least the second central milk line with a cleaning liquid, wherein the connection of the line cleaning device with the second central milk line is located at least equally far from the liquid discharge as the connection of a second discharge line with the second central milk line.