This is another article in the chapter Justice from the classical manual on Sharia called Reliance of the Traveller. The articles are posted one by one in the order they are given in the book.
07.0 WARDING OFF AGGRESSORS
07.1 Someone whom a Muslim is trying to kill is entitled to kill the Muslim, though it is not obligatory to. Someone whom a non-Muslim or animal is trying to kill is obliged to defend himself.
07.2 If an aggressor is trying to take one’s money or property, it is permissible to defend it but not obligatory. If the aggressor intends one’s womenfolk (0: such as one’s wife or son’s wife), it is obligatory to defend them.
07.3 To defend means to use the minimum amount of force required. If one knows that shouting will repel the aggressor, one may not strike him. If a hand is enough, a stick may not be employed, If a stick will do, a sword may not be used. If cutting the other’s hand will suffice, one may not kill him. (0: Mawardi states that this precedence order is for crimes that are not indecencies. As for when an aggressor is raping someone whom it is unlawful for him to have sexual intercourse with, it is permissible to kill him forthwith.) Someone who knows (0: i.e. believes) that an aggressor cannot be dissuaded by anything short of killing him may kill him and is not accountable for it.
07.4 When one has warded off an aggressor, it is unlawful to take further measures against him.