Sayyiduna Jabir (may Allah be pleased with him) said: A man came to the Prophet (peace and blessings be upon him) and said: "I have a slave girl who is also my servant. I have intercourse with her, but I dislike her becoming pregnant." He (peace and blessings be upon him) said: "Practise 'azl with her if you wish, for what has been decreed for her will come to her." After some days the man came again and said: "My slave girl has become pregnant." He (peace and blessings be upon him) said: "I told you that what Allah has decreed for her would come."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النكاح / 14305