مِشْكَاةُ الْمَصَابِيحِ
Mishkat al-Masabih 3184
Marriage
Sexual Intercourse - Section 1
وَعنهُ كُنَّا نَعْزِلُ وَالْقُرْآنُ يَنْزِلُ. مُتَّفَقٌ عَلَيْهِ. وَزَادَ مُسْلِمٌ: فَبَلَغَ ذَلِكَ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَلم ينهنا
He said that in the period when the Qur'an was coming down they used to withdraw the penis.* * i.e. before emission of semen, to avoid conception. (Bukhari and Muslim.) Muslim added that the Prophet (ﷺ) heard of that and did not prohibit it.
Mishkat al-Masabih, 3184مُتَّفق عَلَيْهِ (الألباني)