Fatwa no.
15157
Praise be to Allah, Alone, and peace and blessings be upon the last Prophet.The Permanent Committee for Scholarly Research and Ifta' reviewed the question submitted to His Eminence the President from His Excellency the Officer of Islamic Awareness at the Armed Forces Hospital. The question, no. 622, dated 7/2/1413 A.H., was referred to the Committee from the Council of Senior Scholars. Following is the wordings of His Excellency:In the Armed Forces Hospital, we receive questions (Part No. 24; Page No. 436) regarding
the ruling on masturbation in a hospital laboratory for the purpose of performing sterility tests.
As the sample should be delivered to the laboratory within ten minutes after ejaculation; otherwise it will be useless. What is the ruling on masturbation for medical purposes or any other diseases that require a specimen of semen in the laboratory?
After studying the matter, the Committee replied as follows:
This is permissible due to the dire need for this. The gained benefits have priority over the harm caused by masturbation.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.