Short answer
Yes. A woman must defend herself against rape and may use whatever force is needed to stop the attack, even if the attacker dies. In the Hanafi school she is not sinful and owes no blood money when that force was necessary. She uses the least force that stops him, and once the danger has passed she leaves punishment to the courts.
Defending one's honour against zina is wajib. If the attack can only be stopped by killing, the attacker's blood is unprotected (hadar): no qisas, no diyah and no sin. Force beyond what is needed, or harm done after the danger has ended, is not covered.
The four schools agree on this.
Explanation
Islam does not ask a woman to submit to violence. The Quran praises those who, when wronged, defend themselves. The Prophet ﷺ said that whoever is killed defending his family is a martyr, and when a man asked what to do if someone came to take his property by force, he said: do not give it to him, and if he fights you, fight him; if you are killed you are a martyr, and if you kill him he is in the Fire. A woman's honour and body are more sacred than property.
The Hanafi rule, which the other schools broadly share:
- Self-defence is a duty when someone tries to rape you. You are not expected to stay passive.
- Use the least force that works: shouting, running, hitting, a weapon if needed. If only lethal force will stop him, it is allowed.
- No sin and no blood money if he dies because of necessary defence.
- After the danger: once you are safe, taking revenge yourself is not allowed. Report it to the police and let the law act.
A woman who is assaulted carries no sin at all. She is the one wronged, and her prayers, her chastity and her standing before Allah are untouched. If this has happened to you or someone you know, please reach out to the police, a doctor and a trusted counsellor or imam. Local laws on self-defence also apply, so take advice on the legal side as well.
The evidence
Quran, Surah Ash-Shura 42:39
وَٱلَّذِينَ إِذَآ أَصَابَهُمُ ٱلْبَغْىُ هُمْ يَنتَصِرُونَ ﴿٣٩﴾
And those who, when tyranny strikes them, they defend themselves,
Praises believers who defend themselves against aggression.
Jami' at-Tirmidhi 1421
Grading to be checked... ومن قتل دون أهله فهو شهيد ...
"Whoever is killed defending his family is a martyr."
Defending one's family and honour is rewarded as martyrdom.
Sahih Muslim 140
Sahih... فلا تعطه مالك ...
"Do not give him your property. If he fights you, fight him; if you kill him, he is in the Fire."
Allows fighting back against an aggressor, with no blame for the defender.
Where the ruling is recorded
- al-Hidaya, Kitab al-Jinayat, on killing an aggressor. Whoever draws a weapon on people may be killed to repel him, with nothing owed for his death.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Jinayat. A woman must resist an attempted rape and may kill the attacker if nothing less will stop him.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.