Martial law is the imposition of military rule by military authorities over designated regions on an emergency basis—(usually) only temporary—when the civilian government or civilian authorities fail to function effectively (e.g., maintain order and security, and provide essential services), when there are extensive riots and protests, or when the disobedience of the law becomes widespread. In most cases, military forces are deployed to subdue the crowds, to secure government buildings and key or sensitive locations, and to maintain order. Generally, military personnel replace civil authorities and perform some or all of their functions. In full-scale martial law, the highest-ranking military officer would take over, or be installed, as the military governor or as head of the government, thus removing all power from the previous executive, legislative, and judicial branches of government.
Martial law can be used by governments to enforce their rule over the public. Such incidents may occur after a coup d'état (Thailand 2006); when threatened by popular protest (China, Tiananmen Square protests of 1989); to suppress political opposition (Poland in 1981); 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).