Out-of-battery refers to the status of a weapon before the action has returned to the normal firing position.
The term originates from artillery, referring to a gun that fires before it has been pulled back.
In artillery guns, "out of battery" usually refers to a situation where the recoiling mass (breech and barrel) has not returned to its proper position after firing because of a failure in the recoil mechanism. Most gun carriage designs should prevent this; however, if a gun is fired out of battery, then damage to the carriage can occur, as the effectiveness of the recoil mechanism will have been compromised.
In firearms and artillery where there is an automatic loading mechanism, a condition can occur in which a live round is at least partially in the firing chamber and capable of being fired, but is not properly secured by the usual mechanism of that particular weapon. The gas pressure produced at the moment of firing can rupture the not fully supported cartridge case and can result in flame and high-pressure gas being vented at the breech of the weapon, potentially creating flying shrapnel and possibly injuring the operator.
Depending on the design, it is also possible for a semi-automatic handgun to simply not fire upon pulling the trigger when in an out-of-battery state.