One of my friends had sex with a girl during one of the nights of Ramadaan. He is single and is asking about the ruling and what he has to do.
If what is meant is that he committed zina –Allaah forbid – then zina is a major sin and a serious offence. Allaah has warned us against it and stated that it leads to bad consequences. He says (interpretation of the meaning):
“And come not near to unlawful sex. Verily, it is a Faahishah (i.e. anything that transgresses its limits: a great sin), and an evil way that leads one to hell unless Allaah forgives him)”
Allaah has decreed that the punishment for the zaani is stoning, if he was married, and flogging if he was unmarried. That is because of the abhorrence of what he has engaged in of haraam intimacy. Allaah says (interpretation of the meaning):
“The fornicatress and the fornicator, flog each of them with a hundred stripes. Let not pity withhold you in their case, in a punishment prescribed by Allaah, if you believe in Allaah and the Last Day. And let a party of the believers witness their punishment”
But by the mercy of Allaah, the door of repentance is always open, and Allaah is Oft-Forgiving, Most-Merciful; He loves the repentance of His slaves and accepts it if he turns to Him. Allaah says (interpretation of the meaning):
“Know they not that Allaah accepts repentance from His slaves and takes the Sadaqât (alms, charity), and that Allaah Alone is the One Who forgives and accepts repentance, Most Merciful?”
“Allaah accepts only the repentance of those who do evil in ignorance and foolishness and repent soon afterwards; it is they whom Allaah will forgive and Allaah is Ever All‑Knower, All‑Wise”
“And those who invoke not any other ilaah (god) along with Allaah, nor kill such person as Allaah has forbidden, except for just cause, nor commit illegal sexual intercourse __ and whoever does this shall receive the punishment.
69. The torment will be doubled to him on the Day of Resurrection, and he will abide therein in disgrace;
70. Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allaah will change their sins into good deeds, and Allaah is Oft‑Forgiving, Most Merciful”
How forbearing is Allaah, and how Generous. His goodness descends upon them even as their evil deeds ascend to Him. He holds out His Hand by night to accept the repentance of the one who sinned during the day, and He holds out His hand during the day to accept the repentance of the one who sinned at night. All the sinner has to do is acknowledge his sin and give it up, and ask his Lord for pardon and forgiveness, and resolve never to go back to that sin, and to set his deeds straight, and strive to do that which will please his Lord, may He be blessed and exalted.
The one who does that will find relief, for the Most Gracious, Most Merciful rejoices over the repentance of His slave and accepts it from him, and He will reward him for it and erase his bad deeds thereby, and raise him in status, because He is the Forbearing, Most Generous, Most Kind, Most Merciful, may He be blessed and exalted.
Allaah says (interpretation of the meaning):
“And verily, I am indeed forgiving to him who repents, believes (in My Oneness, and associates none in worship with Me) and does righteous good deeds, and then remains constant in doing them (till his death)”
Moreover, we say to this brother: beware of removing the cover with which Allaah has concealed you and telling anyone of what you have done, because the Prophet (peace and blessings of Allaah be upon him) said: “Avoid these filthy things that Allaah has forbidden. Whoever has done any of them, let him conceal himself with the concealment of Allaah, and let him repent to Allaah.” Narrated by al-Bayhaqi; classed as saheeh by al-Albaani in Saheeh al-Jaami’ (149).
Muslim (2590) narrated from Abu Hurayrah (may Allaah be pleased with him) that the Prophet (peace and blessings of Allaah be upon him) said: “Allaah does not conceal a person in this world but Allaah will conceal him on the Day of Resurrection.”
So hasten to repent and regret, and weep for your sin and wrongdoing. Conceal yourself with the concealment of Allaah and do not speak openly of your sin; do a lot of good deeds such as praying, giving charity, dhikr, and tasbeeh, for these are means of attaining forgiveness.
Beware of procrastinating with regard to repentance, or of taking the forbearance and concealment of Allaah for granted, for Allaah may grant you time or He may not, and He may become angry and seek vengeance. Perhaps He will look at His slave who dares to disobey Him and will say: ‘Go, for I will never accept any good deed from you,’ so he will be utterly lost and his punishment will be Hell. We ask Allaah to keep us safe and sound and to grant us salvation.
We ask Allaah to set the affairs of the Muslims straight, and to bring that back to the right path.
And Allaah knows best.