The concept of justifiable homicide in criminal law is a defense to culpable homicide (criminal or negligent homicide). Generally, there is a burden of production of exculpatory evidence in the legal defense of justification. In most countries, a homicide is justified when there is sufficient evidence to disprove (under the "beyond a reasonable doubt" standard for criminal charges, and "preponderance of evidence" standard for claims of wrongdoing, i.e. civil liability) the alleged criminal act or wrongdoing. The key to this legal defense is that it was reasonable for the subject to believe that there was an imminent and otherwise unavoidable danger of death or grave bodily harm to the innocent by the deceased when they committed the homicide. A homicide in this instance is blameless. Common excusing conditions
Potentially excusing conditions common to multiple jurisdictions include the following. Capital punishment in places that it is legal. Where a state is engaged in a war with a legitimate casus belli, a combatant may lawfully kill an enemy combatant so long as that combatant is not hors de combat. This principle is embedded in public international law and has been respected by most states around the world. In most countries, it is lawful for a citizen to repel violence with violence to protect someones life or destruction of property.The scope of self-defense varies; some jurisdictions have a duty to retreat rule that disallows this defense if it was safe to flee from potential violence.
Example of Criminal Procedure Act in South Africa
In South Africa, §49 Criminal Procedure Act used to provide:

(2) Where the person concerned is to be arrested for an offense referred to in Schedule 1 or is to be arrested on the ground of having committed such an offense, and the person authorized under this Act to arrest or to assist in arresting him cannot arrest him or prevent him from fleeing by other means than killing him, the killing shall be deemed to be justifiable homicide.