Sahih Muslim, Book 16, Hadith 159 (Muslim 3525)

Jabir b. 'Abdullah (Allah be pleased with them) reported that a person asked Allah's Apostle (ﷺ) saying:

I have a slave-girl and I practise 'azl with her, whereupon Allah's Messenger (ﷺ) said: This cannot prevent that which Allah has decreed. The person then came (after some time) and said: Messenger of Allah, the slave-girl about whom I talked to you has conceived, whereupon Allah's Messeuger (ﷺ) said: I am the servant of Allah and His Messenger.