A device (10) and a method for locking a slewable arm of a machine (70), mountable on a vehicle (80). The device (10) comprises a foot (11), which can be securely connected to the vehicle: a slewing system (12), rotatable in relation to the foot, and drivable by a drive (20) to cause the machine to rotate; and locking means (30, 35) for locking the rotation of the slewing system (12) relative to the foot (11), wherein the locking means (30,35) are independent of the drive (20).