The unnatural act is among the major sins
An important point in the regulation of sexual desire by Islam is that, just as it has made zina and its means forbidden, so it has also forbidden the unnatural act, which people know as “liwat” or “the act of the people of Lut”.
This act is filthy, unnatural, defiling with impurity, ruinous to manliness, and an injustice against the woman.
When this filth spreads in a society, corruption arises in their life. They become slaves to this act and then forget morals, custom, and sound taste, all of it. In this matter the story the Quran has related, that of the people of Lut, is sufficient for us. This people began this filthy and shameless act and made it customary. They would leave lawful and pure women in order to commit filthy and forbidden lust. Therefore the Prophet of Allah, Lut (peace be upon him), said to them:
أَتَأْتُونَ الذُّكْرَانَ مِنَ الْعَالَمِينَ 165 وَتَذَرُونَ مَا خَلَقَ لَكُمْ رَبُّكُم مِّنْ أَزْوَاجِكُم ۚ بَلْ أَنتُمْ قَوْمٌ عَادُونَ
Of all the people of the world, is it you who go to males, and leave the wives your Lord has created for you? Rather, you are a people who transgress.
And the Quran, refuting it, declared it to be wrongdoing and transgression, ignorance and corruption, and a crime. As for the punishment of one who commits this shameless act, the jurists differ. Is the hadd punishment for zina to be applied to both the doer and the one it is done to? Or are both to be killed? And then, what method of killing is to be adopted? Should he be killed by the sword, or thrown into a fire, or thrown down from a wall?
Such a severe punishment has been proposed so that the Islamic society may be kept clean of those corrupt and harmful germs from which deadly elements are born.
The ruling on istimna’ (emitting semen by hand)
Sometimes it happens that a natural stirring arises in the blood of young men, and they emit semen with their hand so that their nerves may find relief and the excitement may subside. Nowadays this is called “the secret habit” (a hidden bad habit).
According to most scholars, this is forbidden.
Imam Malik (may Allah have mercy on him) drew evidence from this verse:
وَالَّذِينَ هُمْ لِفُرُوجِهِمْ حَافِظُونَ 5 إِلَّا عَلَىٰ أَزْوَاجِهِمْ أَوْ مَا مَلَكَتْ أَيْمَانُهُمْ فَإِنَّهُمْ غَيْرُ مَلُومِينَ 6فَمَنِ ابْتَغَىٰ وَرَاءَ ذَٰلِكَ فَأُولَٰئِكَ هُمُ الْعَادُونَ
Those who guard their private parts, except from their wives and their slave-women, for in that they are not blameworthy. But whoever seeks anything beyond that, it is they who are the transgressors.
One who emits semen with his hand is committing the adoption of a method other than a wife or a slave-woman for the fulfilment of desire.
And it is reported from Imam Ahmad ibn Hanbal (may Allah have mercy on him) that he regarded semen as a waste matter like the other waste matters of the body, and on that basis considered its emission permissible, just as opening a vein (bloodletting) is permissible. Allama Ibn Hazm al-Zahiri (may Allah have mercy on him) supported this view. And the Hanbali jurists have accepted its permissibility with two conditions:
◈ First, that there be a fear of the man falling into zina.
◈ Second, that he not be able to afford marriage.
The opinion of Imam Ahmad (may Allah have mercy on him) can be adopted in such circumstances when sexual desires prevail and a fear of committing the forbidden arises. For example, a young man who is studying, or works at a place far from home, and is coming into contact with an environment of sexual matters, and on that account feels distress and trouble: in such a case, if he adopts this means to calm the excitement of his nature, there is no harm in it, provided that he does not exceed the limit in this matter and does not become habituated to it. But better than this is the way to which the Messenger of Allah ﷺ has guided. And that is that a young Muslim who cannot marry should fast abundantly, for fasting nurtures willpower, teaches patience, and develops in the mind the capacity for taqwa and the awareness of Allah’s watchfulness. Thus the saying of the Prophet ﷺ is:
يا معشر الشباب من استطاع منكم الباءة فليتزوج فإنه أغض للبصر وأحصن للفرج ومن لم يستطع فعليه بالصوم فإنه له وجاء
O young men! Whoever among you is able to marry should marry, for it is a means of lowering the gaze and guarding the private parts. But whoever is not able to marry should fast, for fasting breaks desire.