In this article I have included what Ibn Al Qayyim says on this matter in full, and what his teacher (Ibn Taymiyyah) also said regarding masturbation.
Navigation For Full Sources
Ibn Al Qayyim’s Explanation
Ibn Taymiyyah (His teacher) on this matter
Summary of Ibn Al Qayyim’s words
Ibn al-Qayyim explains that the permissibility of self-pleasure (masturbation) depends on the individual’s situation.
When Marriage or Concubinage is Possible
If a man is able to marry or take a concubine, then it is unlawful for him to masturbate. Ibn ʿAqil held this view, and while some of their companions only mentioned it being disliked, it was not considered permissible.
When Marriage or Concubinage is Not Possible
If a man is unable to marry or have a concubine, and does not have overwhelming desire that could lead him to fornication, then it remains haram for him to masturbate. This is because it is a form of self-enjoyment, which the Qur’an forbids.
When Desire is Present but Not Overwhelming
If a man has moderate desire and is not at risk of committing fornication, then masturbation is disliked, not unlawful. It is not recommended, but it is not strictly prohibited.
When Desire is Overwhelming and There is Fear of Harm
IF a man’s desire is SO STRONG that he fears falling into fornication, such as a captive, a traveller, or someone poor who cannot marry, then masturbation becomes permissible. This view was explicitly stated by Ahmad ibn Hanbal, who mentioned that the companions used to practice this during their campaigns and travels.
The Ruling Regarding Women with Strong Desire
If a woman has no husband and her desire becomes intense, some of the companions allowed her to use an object such as the “akranij,” a device made from hides in the shape of a male organ, or something similar.
However, the correct opinion, according to Ibn al-Qayyim, is that this is not permissible, because the Prophet ﷺ only recommended fasting for those who cannot marry. If there had been another permissible solution, the Prophet ﷺ would have mentioned it.
Imagining Someone or Thinking of Them by Name
If a person imagines or thinks of someone, such as a wife or concubine, there is no harm if they are absent. The act is permissible, and it does not prevent imagining or picturing them. However, imagining someone unlawful, such as a young male or a foreign woman, is disliked, as it encourages temptation toward something forbidden.
Using Objects for Masturbation
If a person uses an object like a watermelon, dough, or leather to form an idol and inserts himself into it, the ruling is the same as what was previously outlined for masturbation with the hand.
It is not freely permissible, and the action should be avoided unless there is a real need, such as the fear of harm or falling into sin.
Ahmad’s Statement About Fear of Harm and the Discussion of Feeding
Ahmad ibn Hanbal said that if a person’s desire is overwhelming and he fears harm, such as splitting his testicles, then he should feed a poor person as a substitute for fasting. This is because, in his view, the situation is similar to a sick person who cannot fast and must make up for it with feeding.
Continuous Intense Arousal and Expiation
If a fasting person experiences continuous intense arousal, then they should turn to expiation, similar to an elderly person who cannot fast. However, if the person is able to fast later, they should make it up, as expiation is a substitute only when there is despair of making up the fast.
Conclusion from Ibn Al Qayyim’s speech
Ibn al-Qayyim’s view is that masturbation should be avoided unless there is a clear need, such as fear of falling into fornication or harm. Using objects for self-pleasure is not permissible unless there is a necessity. The best course is to avoid such actions unless a real need or fear of harm justifies it. This is only accepted during extreme conditions which are very rare to encounter anyway.
Summarising Ibn Taymiyyah’s Speech on the matter
Ibn Taymiyyah says that patience and chastity are better than masturbation, even in a case where a person fears hardship. He builds this on the Qur’an verse:
وَأَنْ تَصْبِرُوا خَيْرٌ لَكُمْ
“And that you remain patient is better for you.” (Surah An Nisa: 25)
His point is that Allah permitted something lesser, namely marriage to slave women, in a case of need and fear of hardship, yet still said that patience is better.
So if patience is better than that permissible option, then patience from masturbation is even more deserving of being better.
This means that masturbation is not something he presents as a normal solution. Rather, his message is that a person should hold himself back and remain patient.
He also makes clear that masturbation is not like a case of absolute necessity, such as carrion for the starving person. In that kind of case, one cannot usually remain patient without harm. But here, Ibn Taymiyyah says patience is possible. That is why he treats this matter as one where self restraint can still be demanded, even when desire is strong.
He then explains that most of the ulama, early and later, held masturbation to be forbidden in all cases.
He mentions that this is one view in the madhhab of Ahmad ibn Hanbal (d. 241 AH), and that Ibn ʿAqil (d. 513 AH) chose it. He also mentions another report from Ahmad ibn Hanbal, that it is forbidden unless a person fears falling into hardship, and a third report, that it is disliked unless he fears hardship. Even with these reports, Ibn Taymiyyah’s own direction is clear.
He does not present masturbation as something good or preferred. He presents patience as better, and he limits any concession to a narrow case of severe fear.
That severe fear, in his wording, means fear of falling into zina or liwat. So the only case in which a concession is even spoken of is when a person has a strong and serious fear that he will fall into a greater forbidden act. In that situation, some words from Ibn ʿAbbas and some reports from Ahmad ibn Hanbal were understood as a concession to reduce the force of desire. Even then, this is only a restricted concession to prevent something worse. It is not a general permission.
He then sharply closes the door to the way many people fall into this act. If a person does it for pleasure, for enjoyment, from habit, or while bringing sexual thoughts and images to mind, then Ibn Taymiyyah says all of that is forbidden.
He says neither Ahmad ibn Hanbal nor anyone else gave permission for that. So he is clearly separating between a claimed emergency case and ordinary deliberate indulgence. For the ordinary case, he treats it as sinful and not open to excuse.
He then goes further and says that being patient from such acts is not merely recommended. Rather, in this kind of case, it is obligatory. That is because patience from forbidden things is obligatory, even when the soul wants them. He supports this with the Qur’an verse:
وَلْيَسْتَعْفِفِ الَّذِينَ لَا يَجِدُونَ نِكَاحًا حَتَّى يُغْنِيَهُمُ اللَّهُ مِنْ فَضْلِهِ
“And let those who do not find marriage remain chaste until Allah enriches them from His bounty.” (Surah An Nur: 33)
So his message is that the one who cannot marry is not told to relieve himself through forbidden desire. He is told to seek chastity, restrain himself, and wait until Allah gives him ease.
He ends by tying this to the hadith on chastity, self sufficiency, and patience. The meaning is that the servant must struggle against desire, seek chastity from Allah, and train himself to be patient, because patience is among the greatest gifts Allah gives. So the overall message in Majmuʿ al Fatawa 10/573–575 is that masturbation is not a permissible outlet for desire in the normal sense, and Ibn Taymiyyah’s emphasis is on self restraint, chastity, and patience. At most, he speaks of a very narrow concession for one who truly fears falling into a greater act of clear immorality. Outside of that, he treats it as forbidden and says leaving it is obligatory.
Ibn Al Qayyim’s Explanation
The ruling when marriage or concubinage is possible
If a man is able to marry, or to take a concubine, then it is unlawful for him to masturbate with his hand. Ibn ʿAqil said this. He said: “Our companions and our shaykh mentioned nothing except dislike, and they did not state prohibition.”
He said: If he is not able to have a wife, nor a concubine, and he has no desire that would drive him into zina, then it is unlawful for him to masturbate, because it is enjoyment with himself, and the verse prevents it.
If his state is uncertain between low desire and desire, and he has no wife, no female slave, and nothing by which to marry, then it is disliked and not unlawful.
If he is overpowered by his desire, and fears hardship, such as the captive, the traveller, and the poor person, then that is permissible for him. Ahmad (d. 241 AH) stated that explicitly, and it was narrated that the Companions used to do it in their campaigns and travels. (See: Majmuʿ al Fatawa, 229/34–231; al Insaf, 252/10–253.)
The ruling regarding a woman with strong desire
If she is a woman who has no husband, and her desire becomes intense, then some of our companions said: (Meaning: al Qadi Abu Yaʿla Ibn al Farraʾ.)
It is permissible for her to take the akranij, which is something made from hides in the shape of a male organ, which a woman inserts, or something similar, such as a hollow reed, or small gourds, and the correct view with me is that it is not permissible; because the Prophet ﷺ only guided the person of desire, when he is unable to marry, to fasting, and if there had been a meaning besides it, he would have mentioned it.
Thinking of someone by name, or forming a picture in the mind
If he desires, and forms in his mind a person, or calls him by his name, then if it is his wife or his female slave, then there is no harm if he is absent from her, because the act is permissible, and it is not prevented to think of it and picture it. If it is a male youth, or a foreign woman, then it is disliked for him, because it is tempting himself with the unlawful, and urging it towards it.
If he hollows out a watermelon, or dough, or leather, or wood, into an idol, and then inserts into it, then it is according to what was previously set out in detail.
A statement from Ahmad regarding fear of harm, and the discussion of feeding
I said: This is easier than his masturbating with his hand.
Ahmad (d. 241 AH) said about someone whose desire for intercourse is usually dominant, who does not control himself, and fears that his testicles will split: “Feed.” This is the wording that was transmitted from him in al Mughni.
Then he said: “He made it permissible for him to break the fast, because he fears for himself, so he is like the sick person, and like the one who fears destruction for himself due to thirst and the like.
He made feeding obligatory as a substitute for fasting, and this is carried upon the one who does not hope for the possibility of making it up. If he hopes for that, then there is no expiation upon him, and what is obligatory is to wait for making it up, and to do it when he is able, because of His saying: (al Mughni, 396/4–397.)
فَمَن كَانَ مِنكُم مَّرِيضًا
Whoever among you is ill. (al Baqarah 184)
… the verse. Expiation is only turned to when there is despair of making it up. If he fed while despairing, then later he became able to fast, then it is possible that he is not obliged, because his liability has been cleared by performing the expiation that was obligatory, so it does not return to being occupied with what it was cleared from, and it is possible that making it up is obligatory upon him, because feeding was a substitute due to despair, and we have now become clear that it has gone, so it resembles the woman in waiting by months due to despair when she menstruates during it.” (This is the end of the words of the author of al Mughni.)
What was reported in al Fusul about extracting the fluid, and related details
In al Fusul it was narrated from Ahmad (d. 241 AH), regarding a man who feared that his bladder would split from intense arousal, or that his testicles would split because of holding back fluid during Ramadan, that he should extract the fluid. He did not mention by what means he should extract it. He said: “In my view, he extracts it by what does not invalidate the fast of someone else, such as his masturbating with his hand, or with the body of his wife, or his female slave who is not fasting.
If he has a female slave, then he masturbates with her hand, and likewise the non Muslim woman, and it is permissible to have intercourse with her in what is less than the vagina.
If he wants intercourse in the vagina, while it is possible to extract the fluid by other than it, then in my view it is not permissible, because when necessity is removed, what is beyond it becomes unlawful, like becoming full from dead meat.
Rather, here it is more emphatic, because the area of private parts is more emphatic in prohibition than eating.” (For Abu al Wafa Ibn ʿAqil al Hanbali, in fiqh, ten parts, and it is also called Kifayat al Mufti. From it are manuscript copies. See: al Madkhal al Mufassal, 811/2.)
I said: The apparent meaning of the words of Ahmad (d. 241 AH) is the permissibility of intercourse, because he made it permissible for him to break the fast and to feed. If something like this happened during menstruation, then intercourse would not be permissible, by agreement. If that happened to a muhrim, then he would extract his fluid, and intercourse would not be permissible. (See: al Mughni, 405/4.) (See: Tabaqat al Hanabilah, 274/1.)
The case of continuous intense arousal for the fasting person
If the intense arousal of the fasting person continues throughout all time, then making it up falls, and he turns to expiation like the elderly man and the elderly woman. If it occurs for him during the time of summer or winter, then he makes it up in the other time, and there is no expiation here, because it is an excuse that is not continuous, so it is like the sick person. He mentioned that in al Fusul.
Badāʾiʿ al-Fawāʾid (4/1471–1474)
Ibn Taymiyyah (His teacher) on this matter
Patience Is Better
So, Glorified is He, despite permitting marriage to slave women when one lacks the means and fears hardship, He said:
وَأَنْ تَصْبِرُوا خَيْرٌ لَكُمْ
“And that you remain patient is better for you.” (Surah An-Nisa: 25)
This shows that patience is possible even while fearing hardship, and that marriage is not like the permissibility of carrion in a state of extreme necessity, because that is something a person cannot remain patient without.
Likewise, for those who permitted masturbation in a state of necessity, patience in leaving masturbation is still better.
It is narrated from Ibn ʿAbbas that marriage to slave women is better than it, and it is better than zina. So if patience in leaving marriage to slave women is better, then patience in leaving masturbation is, with even greater reason, better.
This is especially so when many of the ulama, or most of them, hold with certainty that it is forbidden in all cases, and this is one of the views in the madhhab of Ahmad ibn Hanbal (d. 241 AH). Ibn ʿAqil (d. 513 AH) chose this in “al Mufradat.”
The well known report from Ahmad ibn Hanbal (d. 241 AH) is that it is forbidden unless he fears hardship.
The third view narrated from him is that it is disliked unless he fears hardship. So if Allah has said concerning marriage to slave women:
وَأَنْ تَصْبِرُوا خَيْرٌ لَكُمْ
“And that you remain patient is better for you.” (Surah An-Nisa: 25)
Then this is even more deserving of that ruling. This shows that patience in leaving both of them is possible.
So if He has permitted what one can still remain patient without, then that is in order to make the duty easier, just as He, the Most High, said:
يُرِيدُ اللَّهُ أَنْ يُخَفِّفَ عَنْكُمْ وَخُلِقَ الْإِنْسَانُ ضَعِيفًا
“Allah intends to lighten matters for you, and man was created weak.” (Surah An-Nisa: 28)
And masturbation is not made permissible, according to most of the ulama, early and later, whether he fears hardship or does not fear it. The words of Ibn ʿAbbas, and what is narrated from Ahmad ibn Hanbal (d. 241 AH) concerning it, only apply to one who fears hardship, meaning zina and liwat (sodomy between males), with a severe fear, such that he fears falling into that. Then it was made permissible for him in order to break the force of his hardship and desire.
As for the one who does that merely for pleasure, or by recalling thoughts, or as a habit, such that he imagines during masturbation the image of a woman as though he were having intercourse with her, then all of that is forbidden.
Neither Ahmad ibn Hanbal nor anyone else said otherwise. Some of them even made the hadd obligatory in that regard. Patience in leaving this is from the obligations, not from recommended acts.
As for patience in leaving forbidden things, then it is obligatory, even if the self desires them and inclines toward them. He, the Most High, said:
وَلْيَسْتَعْفِفِ الَّذِينَ لَا يَجِدُونَ نِكَاحًا حَتَّى يُغْنِيَهُمُ اللَّهُ مِنْ فَضْلِهِ
“And let those who do not find marriage remain chaste until Allah enriches them from His bounty.” (Surah An-Nur: 33)
And chastity here means leaving what has been forbidden, just as occurs in the authentic hadith of Abu Saʿid al Khudri that the Prophet Muhammad ﷺ said: “Whoever seeks chastity, Allah will grant him chastity.
Whoever seeks freedom from need, Allah will grant him freedom from need. Whoever makes himself patient, Allah will grant him patience. And no one has ever been given a gift better and more expansive than patience.” (Sahih al Bukhari, 1469. Sahih Muslim, 1053.)
Majmu Al Fatawa (10/573–575)



