Sunan Ibn Majah — Hadith 1132 (KitabGrid sequence)
It was narrated from ‘Abdullah bin Mas’ud that a man did something with a woman that was less than adultery; I do not know how far it went, but it was less than adultery. He went to the Prophet (ﷺ) and told him about that. Then Allah revealed the words:
حَدَّثَنَا سُفۡيَانُ بۡنُ وَكِيعٍ، حَدَّثَنَا إِسۡمَاعِيلُ ابۡنُ عُلَيَّةَ، عَنۡ سُلَيۡمَانَ التَّيۡمِيِّ، عَنۡ أَبِي عُثۡمَانَ النَّهۡدِيِّ، عَنۡ عَبۡدِ اللَّهِ بۡنِ مَسۡعُودٍ، أَنَّ رَجُلاً، أَصَابَ مِنِ امۡرَأَةٍ يَعۡنِي مَا دُونَ الۡفَاحِشَةِ فَلاَ أَدۡرِي مَا بَلَغَ غَيۡرَ أَنَّهُ دُونَ الزِّنَا فَأَتَى النَّبِيَّ ـ صلى الله عليه وسلم ـ فَذَكَرَ ذَلِكَ لَهُ فَأَنۡزَلَ اللَّهُ سُبۡحَانَهُ {أَقِمِ الصَّلاَةَ طَرَفَىِ النَّهَارِ وَزُلَفًا مِنَ اللَّيۡلِ إِنَّ الۡحَسَنَاتِ يُذۡهِبۡنَ السَّيِّئَاتِ ذَلِكَ ذِكۡرَى لِلذَّاكِرِينَ} فَقَالَ يَا رَسُولَ اللَّهِ أَلِي هَذِهِ قَالَ " لِمَنۡ أَخَذَ بِهَا " .
Translation
Sufyan ibn Waki' narrated to us; Isma'il ibn Ulayyah narrated to us, from Sulayman al-Taymi, from Abu Uthman al-Nahdi, from Abd Allah ibn Mas'ud رضي الله تعالى عنه:
A man did something with a woman, meaning something short of the indecent act. I do not know how far it went, except that it was short of unlawful sexual intercourse. He came to the Prophet صلى الله عليه وآله وسلم and mentioned it to him, and Allah, glorified is He, revealed: 'Establish prayer at the two ends of the day and at the near parts of the night. Good deeds indeed remove evil deeds. That is a reminder for those who remember.' He asked, 'O Messenger of Allah صلى الله عليه وآله وسلم, is this for me?' He replied, 'It is for whoever acts upon it.'
Ready.