A submachine gun (SMG) or sub-gun is a magazine-fed automatic carbine designed to fire handgun cartridges. The term "submachine gun" was coined by John T. Thompson, the inventor of the Thompson submachine gun, to describe its design concept as an automatic firearm with notably less firepower than a machine gun (hence the prefix "sub-"). As a machine gun must fire rifle cartridges to be classified as such, submachine guns are not considered machine guns.
In the 20th century, the submachine gun was developed during World War I (1914–1918) as a close quarter offensive weapon, mainly for trench raiding. At its peak during World War II (1939–1945), millions of submachine guns were made for assault troops and auxiliaries whose doctrines emphasized close-quarter suppressive fire. New submachine gun designs appeared frequently during the Cold War, especially among special forces, commandos and mechanized infantrymen. Submachine gun usage for frontline combat decreased in the 1980s and 1990s.