(49) باب مَا جَاءَ فِي الْعَزْلِ
Muhairiz said "I entered the mosque and saw Abu Sa'id Al Khudri . I sat with him and asked about withdrawing the penis (while having intercourse). Abu Sa'id said We went out with the Apostle of Allaah(ﷺ) on the expedition to Banu Al Mustaliq and took some Arab women captive and we desired the women for we were suffering from the absence of our wives and we wanted ransom, so we intended to withdraw the penis (while having intercourse with the slave women). But we asked ourselves "can we draw the penis when the Apostle of Allaah(ﷺ) is among us before asking him about it? So we asked him about it. He said "it does not matter if you do not do it, for very soul that is to be born up to the Day of Resurrection will be born."
Reference: Sunan Abi Dawud 2172
In-book reference: Book 12, Hadith 127
English translation: Book 11, Hadith 2167