Islamic Ruling on Anal Sex
In Islam, anal sex is totally prohibited and is considered a grave sin whose doer is cursed and incurs the wrath of Allah. The Prophet (peace and blessings be upon him) is reported to have said: “cursed is he who has had sex with a woman in her anus.” (Sunan Abu Dawud and Sunan Ibn Maja’)
Therefore, whoever has done that has to repent sincerely to Allah and desist from such a heinous act. Good deeds wipe out bad ones.