Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:4:25

And whoever among you cannot ˹find˺ the means to marry free, believing women, then ˹he may marry˺ from those whom your right hands possess of believing slave girls. And Allah is most knowing about your faith. You ˹believers˺ are of one another. So marry them with the permission of their people and give them their due compensation according to what is acceptable. ˹They should be˺ chaste, neither ˹of˺ those who commit unlawful intercourse randomly nor those who take ˹secret˺ lovers. But once they are sheltered in marriage, if they should commit adultery, then for them is half the punishment for free ˹unmarried˺ women. This ˹allowance˺ is for him among you who fears sin, but to be patient is better for you. And Allah is Forgiving and Merciful.  

And whoever has not the means wherewith, ˹whoever˺ is not wealthy enough, to be able to marry believing (al-mu’mināt, ‘believing’, is in accordance with the prevalent practice, and does not add to the import), free, women in wedlock, let him take, in marriage, believing maids whom your right hands own. God knows very well your faith, so suffice yourself with its outward manifestation and leave the innermost matters to Him, for He is the One to know her ˹true˺ merit: many a slavegirl may be more excellent ˹in faith˺ than a free woman, and this is meant to encourage marriage with slavegirls; the one of you is as the other, being equal in religion, so do not disdain to marry with them. So marry them, with the permission of their folk, their guardians, and give them their wages, their dowries, honourably, without procrastination or diminution, as women in wedlock (muhsanāt, a circumstantial qualifier), in decency, not illicitly, openly fornicating, or taking lovers, companions fornicating in secret. But when they are given in wedlock, ˹when˺ they are married off (a variant reading ˹for the passive uhsinna, ‘they are given in wedlock’˺ has the active ahsanna, ‘they enter into wedlock’), if they commit lewdness, such as adultery, they shall be liable to half the chastisement, the legal punishment, of married, free, virgin, women, who commit adultery, and are thus given fifty lashes and banished for half a year; ˹male˺ slaves by analogy are liable to the same punishment. Here, God has not made wedlock the precondition for the prescribed punishment to show that stoning does not apply in their case ˹sc. slavegirls˺. That, marrying of slavegirls on account of insufficient means, is for those of you who fear the distress of sin, fornication (al-‘anat originally means distress, but is used to mean zinā, ‘fornication’, because of the distress that it causes in the way of the punishment in this world and in the Hereafter), as opposed to those of you who might not have such a fear ˹of distress˺ with regard to their free women and for whom it is unlawful to marry her ˹the slavegirl˺; likewise for one who has sufficient means to marry a free woman ˹it is unlawful for him to marry a slavegirl instead˺: this is the opinion of alShāfi‘ī. Moreover, God’s words ‘believing maids’ precludes unbelieving women, whom it is unlawful to marry, even if one should find no believing women and fear ˹the distress of fornication˺; yet it is better for you to be patient, and abstain from marrying slavegirls, lest the child should become enslaved also. God is Forgiving, Merciful, by allowing room for manoeuvre in these matters.
القرآن:٤:٢٥

وَمَنْ لَمْ يَسْتَطِعْ مِنْكُمْ طَوْلًا أَنْ يَنْكِحَ الْمُحْصَنَاتِ الْمُؤْمِنَاتِ فَمِنْ مَا مَلَكَتْ أَيْمَانُكُمْ مِنْ فَتَيَاتِكُمُ الْمُؤْمِنَاتِ ۚ وَاللَّهُ أَعْلَمُ بِإِيمَانِكُمْ ۚ بَعْضُكُمْ مِنْ بَعْضٍ ۚ فَانْكِحُوهُنَّ بِإِذْنِ أَهْلِهِنَّ وَآتُوهُنَّ أُجُورَهُنَّ بِالْمَعْرُوفِ مُحْصَنَاتٍ غَيْرَ مُسَافِحَاتٍ وَلَا مُتَّخِذَاتِ أَخْدَانٍ ۚ فَإِذَا أُحْصِنَّ فَإِنْ أَتَيْنَ بِفَاحِشَةٍ فَعَلَيْهِنَّ نِصْفُ مَا عَلَى الْمُحْصَنَاتِ مِنَ الْعَذَابِ ۚ ذَٰلِكَ لِمَنْ خَشِيَ الْعَنَتَ مِنْكُمْ ۚ وَأَنْ تَصْبِرُوا خَيْرٌ لَكُمْ ۗ وَاللَّهُ غَفُورٌ رَحِيمٌ  

(ومن لم يستطع منكم طولا) أي غنى لـ (أن ينكح المحصنات) الحرائر (المؤمنات) هو جري على الغالب فلا مفهوم له (فمن ما ملكت أيمانكم) ينكح (من فتياتكم المؤمنات والله أعلم بإيمانكم) فاكتفوا بظاهره وكِلوا السرائر إليه فإنه العالم بتفضيلها ورب أمة تفضل حرة فيه وهذا تأنيس بنكاح الإماء (بعضكم من بعض) أي أنتم وهن سواء في الدين فلا تستنكفوا من نكاحهن (فانكحوهن بإذن أهلهن) مواليهن (وآتوهن) أعطوهن. (أجورهن) مهورهن (بالمعروف) من غير مطل ونقص (محصنات) عفائف حال (غير مسافحات) زانيات جهرا (ولا متخذات أخذان) أخلاء يزنون بهن سرا (فإذا أحصن) زوجن وفي قراءة بالبناء للفاعل تزوجن (فإن أتين بفاحشة) زنا (فعليهن نصف ما على المحصنات) الحرائر الأبكار إذا زنين (من العذاب) الحد فيجلدن خمسين ويغربن نصف سنة ويقاس عليهن العبيد ولم يجعل الإحصان شرطا لوجوب الحد لإفادة أنه لا رجم عليهن أصلا (ذلك) أي نكاح المملوكات عند عدم الطول (لمن خشي) خاف (العنت) الزنا وأصله المشقة سمي به الزنا لأنه سببها بالحد في الدنيا والعقوبة في الآخرة (منكم) بخلاف من لا يخافه من الأحرار فلا يحل له نكاحها وكذا من استطاع طول حرة وعليه الشافعي وخرج بقوله "" من فتياتكم المؤمنات "" الكافرات: فلا يحل له نكاحها ولو عدل وخاف (وأن تصبروا) عن نكاح المملوكات (خير لكم) لئلا يصير الولد رقيقا (والله غفور رحيم) بالتوسعة في ذلك.