Martial law is the system of rules that takes effect when the military takes control of the normal administration of justice.
Martial law is sometimes imposed during wars or occupations in the absence of any other civil government. Examples of this form of military rule include Germany and Japan after World War II or the American South during the early stages of Reconstruction. In addition it is used by governments to enforce their rule, for example after a coup d'état (Thailand 2006), when threatened by popular protests (Tiananmen Square protests of 1989), or to crack down on the opposition (Poland 1981). Martial law can also be declared in cases of major natural disasters; however most countries use a different legal construct, such as a "state of emergency".
In many countries martial law imposes particular rules, one of which is curfew. Often, under this system, the administration of justice is left to a military tribunal, called a court-martial. The suspension of the writ of habeas corpus is likely to occur.