An arrangement for housing and milking a large number of animals includes a resting and feeding area (11), a milking area (13) housing automatic milking stations (31) for milking the animals, and a passage way (15) interconnecting the resting and feeding area (11) and the milking area (13), and along which animals are capable of being had to walk in order to move back and fourth between the resting and feeding area (11) and the milking area (13). According to the invention, the resting and feeding area (11) includes enclosed sections (17), wherein each of the sections (17) houses a respective subgroup of the animals and has an entry/exit gate (19), through which the animals of the subgroup are capable of being forced to pass in order to move back and fourth between the section (17) and the passage way (15).