A pen (1) for domestic animals, preferably sows, the pen having a size such that one of these animals can stay in the pen. The pen has a rear gate (4) which is hinged horizontally and positioned above the animals back in the open position. The rear gate (4) has a release mechanism for releasing the rear gate (4) from the closed condition. The release mechanism is adapted to allow release of the gate from closed condition by a rearwards directed push against the rear gate by the animal in the pen. Furthermore, the release mechanism includes a pivoting arm (28) on the rear gate, the pivoting arm being connected with a barb (26) for releasing the barb from engagement with a fitting (24) when the pivoting arm is moved rearwards.