A gunship is a military aircraft armed with heavy guns, primarily intended for attacking ground targets.
The term gunship originated in the mid-19th century as a synonym for gunboat and also referred to the heavily armed ironclad steamships used during the American Civil War.
During 1942 and 1943, the lack of a usable escort fighter for the United States Army Air Forces in the European Theatre of Operations led to experiments in dramatically increasing the armament of a standard Boeing B-17F Flying Fortress, and later a single Consolidated B-24D Liberator to each have 14 to 16 Browning AN/M2 .50 cal machine guns as the Boeing YB-40 Flying Fortress and Consolidated XB-41 Liberator "heavy fighters" respectively; each meant to accompany regular heavy bomber formations over occupied Europe on strategic bombing raids for long-range escort duties. The YB-40 was sometimes described as a "gunship" and a small 25-aircraft batch of the B-17-derived "gunships" were built, with a dozen of these deployed to Europe; while the XB-41 remained a prototype only.
During World War II, the urgent need for hard-hitting attack aircraft led to the development of the heavily armed gunship versions of the North American B-25 Mitchell. The 405 examples produced of the B-25G variant were armed with a 75 mm (2.95 in) M4 cannon and the thousand examples produced of the B-25H followed with a lighter TE13E1 cannon of the same caliber. The most-built B-25J variant omitted such heavy-calibre weaponry, but could in some cases, carry an impressive total of eighteen "Ma Deuce" AN/M2 Browning .50-cal machine guns, more than any other contemporary American aircraft: eight in the nose, four in under-cockpit flank-mount gun pod packages, two in the dorsal turret when aimed directly forward, one each in the pair of waist positions, and a pair in the tail—with fourteen of the guns either permanently aimed forward, or aimable directly forward in the dorsal turret — relocated to a forward position for both the -H and -J subtypes as produced — for strafing missions. Later the B-25J was additionally armed with eight 5 in. (130 mm) high velocity aircraft rockets (HVAR).