مشكوة المصابيح Mishkat al-Masabih كتاب النكاح The Book of Marriage
(بَيَانُ العَزْلِ (تَخْطِيطِ الأُسْرَةِ))

(Explanation of coitus interruptus (family planning))

1 hadith
Hadith 3184
وَعنهُ كُنَّا نَعْزِلُ وَالْقُرْآنُ يَنْزِلُ. مُتَّفَقٌ عَلَيْهِ. وَزَادَ مُسْلِمٌ: فَبَلَغَ ذَلِكَ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَلم ينهنا
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.
Hadith Reference Mishkat al-Masabih / The Book of Marriage / Hadith: 3184
Hadith Grading الألبانی: مُتَّفق عَلَيْهِ  |  زبیر علی زئی: صحيح
Hadith Takhrij ´تحقيق و تخريج: محدث العصر حافظ زبير على زئي رحمه الله` «رواه مسلم (1440/138)»