He—may Allah Most High have mercy on him—was asked:
Concerning those who spread corruption in the land and treat people’s property and lives as lawful to take, such as thieves and highway robbers: may a person give them some of his property, or may he fight them? If a man kills one of them, is he to be accused of hypocrisy? Does he incur any sin by killing someone who sought to kill him?
He answered:
The Muslims unanimously agree that fighting highway robbers is permissible. It is authentically established that the Prophet, may Allah bless him and grant him peace, said:
“Whoever is killed defending his property is a martyr.”
If “highway robbers” demand the property of someone entitled to legal protection, he is not obliged to give them anything, by agreement of the imams. Rather, he should repel them using the least force necessary, escalating only as needed. If they cannot be repelled except by fighting, he may fight them. If he is killed, he is a martyr; if he kills one of them in these circumstances, no liability is incurred for that person’s death. Likewise, if they seek to kill him, he may repel them, even by killing them, according to unanimous agreement.
However, defending one’s property is not obligatory: a person may give them the property rather than fight them. As for defending one’s life, there are two opinions concerning whether it is obligatory, corresponding to two positions reported from Ahmad.