<p>The device has a safety unit (6) for safekeeping a firearm to a base. The safety unit is partially inserted in a barrel and/or a cartridge mount of the firearm. The safety unit includes a safety section (12), which is brought into a safety condition in which the safety unit is secured in the firearm and in a release condition in which the safety unit is separable from the firearm. A control brings the safety section in its release condition with the authorization of the user to separate the firearm and the safety unit. An independent claim is also included for a safety unit for safekeeping a firearm to a base.</p>