This topic comes up frequently in the media. Whenever a person’s name begins with Omar or Ahmed (or any other Muslim name for that matter), they portray it as if the religion sanctions it as such. They do not care if the perpetrator has never practised their faith. As long as they can stir up more hatred towards Islam and Muslims, they have achieved their satanic goals, in demonizing the Muslim community.
The aim of this article is to refute the claims made by critics that ‘Islamic Law does not punish rapists’. Moreover, I have touched upon this topic before – you can read it here.
The following is an excellent excerpt on how the perpetrators of rape were dealt with in the lifetime of Prophet Muhammed (p) and the Companions. It is written by Islamic scholar Dr. Mufti Allie Haroon Sheikh (May God reward him for his efforts).
Dr. Mufti Allie (or Ali) Haroon Sheikh
Islam has not only withdrawn all its leniency on the rapist but also the wrath against the offender is in full fury. The punishment of the criminal is that it is, but the authority sitting in judgement has also been warned and instructed that here at least he should not grant any concession to the violator to whom Islam has emphasized the importance of sexual morality and along with it displayed to him the detrimental effect of forceful, violent rape. He should be reminded of the maximum freedom granted to him in satisfying his sexual appetite by approved means, but in spite of this, he wilfully transgressed the limits extended to him by Shari’ah without any disregard.
The woman who has become the victim of such brutality and is compelled to commit illegal sexual intercourse against her will is exempted from punishment as the Qur’an declares:
“But if anyone compels them, yet after such compulsion is Allah Most Forgiving, Most Merciful.” – Quran 24:33
In the days of ignorance some men subjected their slave-women to forceful harlotry for contemptible worldly gain. Since the element of coercion was utilized on these women who desired chastity, they were therefore ‘raped’ against their will.
Imam Bukhari narrates the following incident wherein a slave raped a slave girl. The culprit was brought before the court of Hadhrat Umar, who after investigating the case, sentenced the offender, but acquitted the slave girl who was forcefully raped.
“Safiya bint Ubaid: ‘A Governmental male slave tried to seduce a slave girl from the Khumus of the war booty till hedeflowered her by force against her will; therefore Umar flogged him according to the law and exiled him, but he did not flog the female slave because the slave had compelled her to indulge in illegal sexual intercourse with her consent.” – (Bukhari, op. cit. Chapter on ‘No punishment for the raped girl’ volume 2: 1027-8)
There is also another incident which occurred during the time of the Prophet (p) when a woman came out of her house to join the congregational prayer in the mosque. En-route she was forcefully grabbed by a man who raped her. She screamed and her cries alerted the people who rushed to her rescue and caught the rapist red-handed. He was then produced before the Prophet (p). The rapist confessed his guilt and he was punished according to the verdict given by the Prophet (p): And to the woman he said:
“Go, you have been forgiven by Allah.” – (Jam ’al-Fawaid, op. cit. volume 1: 287)
Therefore in forced sexual intercourse such as rape, the innocent party cannot be punished at all. On the contrary he or she is entitled to compensation in some form or the other. 
 Morality In Islam [First Edition 2004 – Printed At Ilmi Graphics] By Dr. Mufti Allie Haroon Sheikh page 236 – 237