Having anal sex with one’s wife is unlawful in Islam because Allah (Exalted and Glorified be He) says: “Your women are a tilth for you (to cultivate) so go to your tilth as ye will.” (Al-Baqarah: 223) And the anus is not a place of cultivation. The Messenger of Allah (peace and blessings be upon him) is reported to have said: “Allah is not too shy to tell you the truth: do not have intercourse with your wives in the anus.”
the four schools of Islamic jurisprudence and other Muslim jurists have unanimously agreed that anal sex is haram (unlawful).
In this regard, we would like to cite for you the following fatwa issued by Sheikh Muhammad Saleh Al-Munajjid, the prominent Saudi Islamic lecturer and author, states the following: “Allah Almighty says, “Your women are a tilth for you (to cultivate) so go to your tilth as ye will.” (Al-Baqrah: 223)
From the word harth (tilth) we understand that what is permissible is only in the vagina (the front passage) because this is what will produce children. The semen that is planted in the womb from which offspring come is likened to the seeds which are planted in the ground, from which vegetation comes, as both of them are substances from which something else is produced.
the phrase translated as “as ye will” means in any manner you wish, that is, from behind or from the front, sitting or with the wife lying on her back or on her side, so long as it is in the place of tilth (i.e., the vagina, the place from which a baby is born).
It was reported from Khuzaymah ibn Thabit (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: “Allah is not too shy to tell you the truth: do not have intercourse with your wives in the anus.” (Narrated by Ahmad)
Ibn `Abbas (may Allah be pleased with him) quoted the Messenger of Allah (peace and blessings be upon him) as saying, “Allah will not look at a man who has intercourse with his wife in her anus.”
If a man does this, his wife is not considered to be divorced as many people think because there is no evidence from either the Qur’an or the Sunnah at all which indicates this. But the scholars said that if a man habitually does this, his wife has the right to ask for a divorce because he is an evildoer or fasiq who is causing harm by his action, and also because the purpose of marriage cannot be achieved through this action. The wife has to resist this evil action and remind her husband about Allah and about the punishment for transgressing the limits set by Him. If the husband repents to Allah from this deed, there is no reason why she should not stay with him, and there is no need to renew the marriage contract.”
Based on the above fatwa, we call upon couples who do this to repent for the sin you have committed. Shed tears and inch closer to Allah in this blessed month of Ramadan to replace your bad deeds with good ones. As for your Nikah, it is still valid, in sha’ Allah.