Praise be to Allah.
It is by Allah’s wisdom that when He forbids a thing He forbids the things that lead to it, because indulging in things that may lead to haraam may make the heart inclined towards it, in such a way that the individual develops a psychological conflict between falling into this sin or the suffering that results from standing in the middle of the road, so that he is not shunning the haraam thing entirely, with the peace of mind that comes from keeping away from it, nor is he committing the sin and fulfilling the desires of his self that is inclined towards evil. In most cases of this type, the person will fall into major sins that he thought he would never commit, major sins that corrupt his religious and worldly affairs, ruin his life, and destroy the blessing in his wealth and children, as a befitting punishment for his sin, because he moved away from his Lord and transgressed His sacred limits, and did not care that Allaah was watching him and was aware of what he was doing. The wise man is the one who is not careless about things that lead to real disasters that affect his religious commitment, which is a man’s capital and comes before any worldly consideration.
The one who thinks about this question will realize that it is impossible for a man to reach that level of evil and then be able to control himself and refrain from falling into that great sin, which is as nothing compared to the anger and wrath of Allaah and the corruption that it causes, all just for the sake of the short-lived pleasure that the sinner is trying to achieve, which will be followed by never-ending regret.
The Muslim has to understand things as they are and what they lead to, and not be tempted by the things that the Shaytaan makes attractive, or be deceived when the Shaytaan tries to make him think of evil actions as insignificant as a trick to make people join his party of losers. He has to fear Allaah his Lord in private and in public, and know that Allaah sees him and knows his intentions and his actions, as Allaah says (interpretation of the meaning):
“Allaah knows the fraud of the eyes, and all that the breasts conceal”
He should remember that what is with Allaah is better and more lasting, and that the Hereafter and its blessings are better for him than this world, and that the reward for being patient in abstaining from evil actions is Paradise as vast as the heavens and the earth, in which there is whatever a person could want of absolute and untainted pleasure.
For more information on the ruling please see question no. 27259
Anal intercourse, if done with a man, is homosexuality which is condemned in the Qur’aan and Sunnah.
It was one of the causes of the destruction of a nation, namely the people of Loot, the Prophet of Allaah.
With regard to anal intercourse with a woman: if this is with one's wife, it is not permissible, and is known as “lesser sodomy”, so how about if it is with a woman who is not permissible for him?
(a)What was narrated concerning sodomy:
Ibn Hazam said:
The action of the people of Loot is a major sin and a forbidden immoral action, like eating pork, dead meat and blood, drinking alcohol, committing adultery, and all other sins. Whoever regards it as permissible or regards any of the things we have mentioned as permissible is a kaafir and a mushrik, whose blood may be shed and whose wealth may be seized.
Ibn Qudaamah said:
The scholars are unanimously agreed that sodomy is forbidden. It was condemned by Allaah in His Book, and by the Messenger of Allaah (peace and blessings of Allaah be upon him). Allaah says (interpretation of the meaning):
“And (remember) Loot (Lot), when he said to his people: ‘Do you commit the worst sin such as none preceding you has committed in the ‘Aalameen (mankind and jinn)?
Verily, you practise your lusts on men instead of women. Nay, but you are a people transgressing beyond bounds (by committing great sins)’”
And the Prophet (peace and blessings of Allaah be upon him) said: “May Allaah curse those who do the deed of the people of Loot, may Allaah curse those who do the deed of the people of Loot, may Allaah curse those who do the deed of the people of Loot.”
Ibn al-Qayyim narrated from his shaykh Ibn Taymiyah and from others that there was consensus among the Sahaabah that the one who does the deed of the people of Loot should be put to death, but they differed as to how that should be done.
Zaad al-Ma’aad, (5/40). For more details on the ruling see also question no. 10050.
(b)What was narrated concerning anal intercourse with a woman:
Anal intercourse with a woman is a major sin, and the Prophet (peace and blessings of Allaah be upon him) cursed the one who does that.
Abu Dawood (2162) narrated that Abu Hurayrah said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Cursed is the one who has intercourse with his wife in her back passage.” Classed as hasan by al-Albaani in Saheeh Abi Dawood. This curse applies to one who has anal intercourse with his wife, so how about if the woman is a stranger (non-mahram) to him?
Al-Tirmidhi (135) narrated from Abu Hurayrah that the Prophet (peace and blessings of Allaah be upon him) said: “Whoever has intercourse with a menstruating woman or with a woman in her back passage, or who goes to a soothsayer, has disbelieved in that which was revealed to Muhammad (peace and blessings of Allaah be upon him).” Classed as saheeh by al-Albaani in Saheeh al-Tirmidhi.
If a man and wife agree to anal intercourse and do not stop after being punished (with a ta’zeer punishment), then they are to be separated.
Shaykh al-Islam Ibn Taymiyah was asked about a man who has intercourse with his wife in her back passage.
Having anal intercourse with a woman is haraam, according to the Qur’aan and Sunnah, and this is the view of the majority of earlier and later scholars. Indeed, this is “lesser sodomy”. It was proven that the Prophet (peace and blessings of Allaah be upon him) said: “Allaah is not too shy to tell the truth. Do not have intercourse with women in their back passages.” And Allaah says (interpretation of the meaning):
“Your wives are a tilth for you, so go to your tilth, when or how you will”
The tilth (harth) is the place from which the child is born [the vagina], because the tilth is the place of planting and sowing. The Jews used to say that if a man had intercourse with his wife from behind, the child would be born with a squint, then Allaah revealed this verse, and Allaah allowed the man to have intercourse with his wife in all positions, so long as it is in the vagina only. Whoever has intercourse with her in her back passage, and she obeys him in that, they should both be punished, and if they do not stop, then they should be separated, as an immoral man and the person with whom he commits immoral actions should be separated, and Allaah knows best.
Al-Fataawa al-Kubra, 3/104, 105
With regard to having intercourse with a non-mahram woman in her back passage, the scholars differed as to whether this is zina (fornication) or sodomy.
See al-Mabsoot, 9/77; al-Faakihah al-Dawaanah, 2/209; Mughni al-Muhtaaj, 5/443; al-Insaaf, 10/177; al-Furoo’, 6/72
The view favoured by Shaykh al-Sa’di (may Allaah have mercy on him) is that having intercourse with a non-mahram woman in her back passage is considered to be zina (fornication). He said: Zina means having an unlawful sexual relationship in the front passage or the back passage. Manhaj al-Saalikeen, p. 239.
We ask Allaah to keep us safe from evil and to purify our hearts of evil thoughts, and to help us to be steadfast in adhering to His religion and obeying His commands.
And Allaah knows best.