The invention refers to an apparatus for detecting an animal ( 1 ) having a body part ( 2 ) and a head part ( 3 ). The apparatus includes an animal passage ( 4 ) extending in a transport direction (t), and a sensor device ( 7,8 ) arranged to sense the animal in the passage. The passage is defined by a first enclosure member ( 5 ) and a second enclosure member ( 6 ). The enclosure members are arranged on a respective side of the passage and extend substantially in parallel to the transport direction. The sensor device is arranged to sense a parameter related to a cross-section size of the animal at a determined position in the passage, and to produce a signal when the parameter fulfils a certain condition.