Back to search

What is the ruling on masturbation out of necessity to avoid homosexuality, bearing in mind commitment to prayer, memorizing the Qur’an, engaging in sports, and being occupied with studies?

1 min readAlso available in العربية

Masturbation is forbidden, but if one fears falling into indecency, then they may do it. However, merely alleviating the feeling of desire is not a justification.

A Muslim must strive in acts of worship and be sincere to Allah to protect themselves from Satan, as Allah Almighty said: "Indeed, there is no authority for him over those who believe and who trust in their Lord" (An-Nahl: 99). And as He said about Yusuf (Joseph), peace be upon him: "And she certainly desired him, and he would have desired her had he not seen the proof of his Lord. Thus, We diverted from him evil and immorality. Indeed, he was one of Our sincere servants" (Yusuf: 24).

It is recommended to frequently supplicate and humble oneself before Allah to divert forbidden desires.

Summarized from the full answer at Ftawy · reviewed Sep 2, 2026

Read the full answer on Ftawy