Is It Haram to Think Sexually?
Question

We got married three and a half years ago, and he is very good and very religiously committed. We worship Allah together as much as we can, praise be to Allah. But the problem started with me from the beginning of the marriage. Whilst having intercourse, he had to tell me sexual stories and I would use my imagination, because I could not reach climax otherwise. 
In order to feel satisfied I have to fantasize. The problem with me is that I feel guilty every time after having intercourse, because the images that I fantasize about stay with me– I never imagine myself with any other person at all, only people whom I do not know. 
I told him about this problem and he did not get angry, but I feel like it is a kind of betrayal. What should I do? Please advise me. What is the Islamic ruling?
Praise be to Allah.Is it haram to have sexual fantasies?
Sexual fantasies are among the thoughts that cross a person’s mind because it is something that is stored in the subconscious which is affected by the environment in which he lives and the scenes that he sees. These are thoughts that occur to most people, especially the youth, but they vary from one person to another with regard to their type, strength and effect. 
Islamic shari’ah is the shari’ah of the fitrah (natural state of man) and it is in harmony with human nature, and it takes into account the psychological fluctuation that Allah has made a part of the human make-up. So it does not go beyond human limitations or impose impossible burdens. 
Allah says (interpretation of the meaning): 
“Allah burdens not a person beyond his scope.” [al-Baqarah 2:286]
Abu Hurayrah (may Allah be pleased with him) narrated that the Prophet (peace and blessings of Allah be upon him) said:  “Allah has forgiven my ummah for whatever crosses their mind so long as they do not speak of it or act upon it.” (Narrated by al-Bukhari (2528) and Muslim (127)
Al-Nawawi (may Allah have mercy on him) said commenting on this hadith: 
“Whatever crosses a person’s mind, so long as he does not dwell on it or continue to think of it, he is forgiven for it, according to scholarly consensus, because it does not happen voluntarily and he has no way of avoiding it.” (Al-Adhkar, p. 345) 
Passing fancies come under the heading of that which crosses a person’s mind, which is forgiven according to the hadith quoted above. So if a person imagines haram things that came to his mind unbidden, there is no blame or sin on him, rather he has to ward them off as much as he can.
 How does Islam view haram sexual fantasies? 
If a person dwells on haram thoughts and calls them to mind, then the jurists differed as to how to view this situation – is it covered by that forgiveness or does it come under the heading of thinking and resolving to do something haram) for which a person may be called to account? 
This issue was discussed by the jurists in the following manner: 
If a man is having intercourse with his wife and is thinking of the charms of another woman, so that he imagines he is having intercourse with her, are those thoughts and fantasies haram? The jurists differed concerning that. 

The first view is that it is haram, and that the one who deliberately brings haram images to mind whilst having intercourse with his wife is sinning. 

Ibn ‘Abidin al-Hanafi (may Allah have mercy on him) said: 
“The view that is closest to the spirit of our madhhab is that it is not permissible, because imagining that woman as if he is having intercourse with her is imagining oneself committing a sin with a woman who is not permissible for him.” (Hashiyat Radd al-Muhtar, 6/272) 
Imam Muhammad al-‘Abdari, who is known Ibn al-Haj al-Maliki (may Allah have mercy on him), said: 
“A man should refrain from thinking such thoughts and tell others to avoid this behaviour too, i.e., this obnoxious characteristic that has unfortunately become very common, which is when a man sees a woman whom he likes, he goes to his wife and has intercourse with her, and starts to imagine that woman whom he has seen. 
This is a kind of zina (adultery) because of what our scholars (may Allah have mercy on them) have said about the one who takes a tankard and drinks water from it, but he imagines that it is alcohol that he is drinking – so that water becomes haram for him. 
What we have mentioned does not apply only to men, rather it also includes women, and it applies even more so to them, because what is common nowadays is that they go out or look out from windows, and if they see someone whom they like, they start thinking about him, then when they have intercourse with their husbands they bring that image that they have seen to mind, so each of them may be committing zina in some sense – we ask Allah to keep us safe from that. 
He should not only avoid that himself, he should also draw his family’s and other people’s attention to it, and tell them that this is haram and is not permitted.” (Al-Madkhil (2/194, 195) 
Ibn Muflih al-Hanbali (may Allah have mercy on him) said:  
“Ibn ‘Aqil stated in al-Ri’ayah al-Kubra that if a man imagines the image of another woman who is forbidden to him whilst having intercourse with his wife, he is sinning, but a passing thought that he cannot prevent does not constitute a sin.” (Al-Adab al-Shar’iyyah (1/98) 
The evidence for this opinion is the view favoured by a number of scholars, that if thoughts that cross the mind become entrenched and may turn into something that one resolves to do, then they come under the heading of things for which one is accountable, and that haram fantasies that a person deliberately calls to mind are not covered by forgiveness, because they have been thought of deliberately and the person will be called to account for that. 
Al-Nawawi (may Allah have mercy on him) said: “The reason why passing thoughts are forgiven is what we have mentioned above, that they cannot be avoided. But it is possible to avoid dwelling on them. Hence dwelling on them is haram.” (Al-Adhkar (345) 

The second view is that it is permissible, and that there is no sin on the one who does that. This is the view of a number of later Shafi'i scholars, such as al-Subki and al-Suyuti. 

They said: That is because there is no resolve or determination to sin in fantasies. He may imagine that he is having intercourse with that woman, but there is no resolve in his heart or any plan to do that, rather he may refuse if given the opportunity to do it. 
It says in Tuhfat al-Muhtaj fi Sharh al-Minhaj (7/205, 206) – which is a Shafi'i book: 
“Because when he thinks of that or imagines it, it does not occur to him to actually commit zina or do any of the things that lead to it, let alone resolve to do it. All that is happening to him is that he imagines something reprehensible as something good.” (See: al-Fatawa al-Fiqhiyyah al-Kubra, 4/87) 
It seems that the correct view is the view that such fantasies are makruh, even if we do not say that they are haram. That is for the following reasons: 

Many psychologists regard sexual fantasies as a psychological disorder if they dominate a person’s thinking to such an extent that he cannot enjoy any pleasure except through these fantasies, and that may lead to abnormal sexual fantasies.
Islamic shari’ah teaches the principle of sadd al-dharai’ or blocking the means that may lead to haram things and closing every door that may lead to evil. It is to be expected that sexual fantasies may lead to a person committing haram deeds. A person who frequently imagines something and wishes for it will inevitably develop the motive to do it and will try to do it a great deal. So he starts by looking at haram images, and his eyes become accustomed to looking at haram things, then he will try to fulfil his fantasies.
Most of these fantasies come to people’s mind by haram means in people’s minds, such as permissive satellite channels and by watching scenes of decadent societies from kafir lands all over the world, where there is no modesty and watching sex scenes is becoming a daily habit, as is obvious to anyone who lives or works in those countries.
Finally, such fantasies may lead to spouses losing interest in one another, so the wife is no longer attractive to her husband, and vice versa, which leads to marital problems, and then sufferings and problems start.

How to avoid sexual fantasies 
For all of these reasons, our advice to everyone who is tested with such fantasies is to hasten to put a stop to them and rid himself of them. The following means may be of help: 

Completely avoiding everything that may provoke such fantasies, such as haram movies and TV shows which are shown on satellite TV, as well as avoiding reading stories that generate such fantasies. Al-Ghazali said in Ihya ‘Ulum al-Din (1/162): 

The way to ward off distracting thoughts is to cut off their source, i.e. avoid the means that could create these thoughts; if the source of such thoughts is not stopped, it will keep generating them.”

Regularly reciting the adhkar that are prescribed in shari’ah, especially that which is said before having intercourse: “Allahumma jannibna al-shaytana wa jannib al-shaytana ma razaqtana (O Allah, keep the Shaytan away from us and keep the Shaytan away from that with which You bless us).” Narrated by al-Bukhari (141)and Muslim (1434). 
Focusing on the present enjoyment instead of that which is absent. In both spouses there is that which will keep the other from thinking of haram things. If each spouse focuses on the attractions of the other, they will not be distracted by fantasies of other things. 
Imagine if your husband had fantasies like you do, would you accept that? Wouldn’t that make you feel unhappy? How can you accept to make your husband feel like that? Try to use this thought to get rid of what you are feeling. 
Consult psychologists. There is nothing wrong with going to a female psychologist or female doctor and asking her for advice; you may find something to help you in sha Allah. 

I ask Allah to guide and bless you and your husband. 
And Allah knows best.