Martial law represents the imposition of rule via military authorities on an emergency basis, such as foreign invasion, rioting, or natural disaster. It is usually imposed on a temporary basis if the civilian government fails to function properly. Military forces may be deployed for various purposes such as to stop looting, maintain order, impose a curfew, and secure buildings of the government.