Martial law is the imposition of the highest-ranking military officer as the military governor or as the head of the government, thus removing all power from the previous executive, legislative, and judicial branches of government.
It is usually imposed temporarily when the government or civilian authorities fail to function effectively (e.g., maintain order and security, or provide essential services).
Martial law can be used by governments to enforce their rule over the public. Such incidents may occur after a coup d'état (such as Thailand in 2006 and 2014); when threatened by popular protest (China, Tiananmen Square protests of 1989); to suppress political opposition (Poland in 1981); or to stabilize insurrections or perceived insurrections (Canada, The October Crisis of 1970). Martial law may be declared in cases of major natural disasters; however, most countries use a different legal construct, such as a state of emergency.
Martial law has also been imposed during conflicts and in cases of occupations, where the absence of any other civil government provides for an unstable population. Examples of this form of military rule include post World War II reconstruction in Germany and Japan as well as the southern reconstruction following the U.S. Civil War.
Typically, the imposition of martial law accompanies curfews, the suspension of civil law, civil rights, habeas corpus, and the application or extension of military law or military justice to civilians. Civilians defying martial law may be subjected to military tribunal (court-martial).