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.
bayhaqi:18307Abū Bakr Aḥmad b. al-Ḥasan al-Qāḍī > Abū Jaʿfar Muḥammad b. ʿAlī b. Duḥaym > Aḥmad b. Ḥāzim > ʿAwn b. Sallām > Abū Maryam > al-Ḥakam b. ʿUtaybah > Maymūn b. Abū Shabīb > ʿAlī > Aṣabt a neighboriyah from al-Saby Maʿahā Ibn Lahā Faʾaradt > Abīʿahā And ʾUmsik Āb.ahā

[Machine] To me, the Messenger of Allah ﷺ instructed to either release both of them or detain both of them.  

البيهقي:١٨٣٠٧أَخْبَرَنَا أَبُو بَكْرٍ أَحْمَدُ بْنُ الْحَسَنِ الْقَاضِي أنبأ أَبُو جَعْفَرٍ مُحَمَّدُ بْنُ عَلِيِّ بْنِ دُحَيْمٍ ثنا أَحْمَدُ بْنُ حَازِمٍ أنبأ عَوْنُ بْنُ سَلَّامٍ عَنْ أَبِي مَرْيَمَ عَنِ الْحَكَمِ بْنِ عُتَيْبَةَ عَنْ مَيْمُونِ بْنِ أَبِي شَبِيبٍ عَنْ عَلِيٍّ ؓ قَالَ أَصَبْتُ جَارِيَةً مِنَ السَّبْيِ مَعَهَا ابْنٌ لَهَا فَأَرَدْتُ أَنْ أَبِيعَهَا وَأُمْسِكَ ابْنَهَا فَقَالَ

لِي رَسُولُ اللهِ ﷺ بِعْهُمَا جَمِيعًا أَوْ أَمْسِكْهُمَا جَمِيعًا