Question: A man got into his car at night and drove off. Suddenly he was met with bullets pouring down upon him and his car. One of the bullets directed at him wounded him. He stopped his car and stepped out immediately to defend himself. He saw one of his attackers pass in front of the car’s headlights, so he killed him, while the rest of the attackers were hiding. What is required of this man who defended himself, for his killing one of his attackers?
The answer – and Allah is the One who grants success – is that a person has the right to defend himself, even by killing, and even in the Sacred Precinct (al-ḥaram al-muḥarram). In such a situation, nothing at all is required of him – neither a little nor a lot: no qiṣāṣ, no blood-money, and no expiatory fast. Allah, exalted is He, has said: “Permission [to fight] has been given to those who are being fought, because they were wronged; and indeed Allah is competent to give them victory.” [al-Ḥajj:39].
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2