Islam is indeed against adultery, and there are rules that govern these conditions according to the applicable classification:
- Walad al-zina (Arabic: ولد الزنا): offspring from adultery where both parents are known and acknowledge their parenthood.
- Walad al-mulā'ana (Arabic: ولد الملاعنة): offspring of curse-invoking where husband accuses wife of committing adultery and refuses to acknowledge the expected child as his.
- Walad al-shubha (Arabic: ولد الشبهة): offspring of obscurity where both parents are known, but the act of adultery was committed while thinking that it was legitimate.
- Al-laqīt (Arabic: اللقيط): abandoned offspring where neither parent is known. This child is treated as a legitimate child (born within wedlock) unless proven otherwise.
Where there is a difference in rulings, this answer focuses on walad al-zina (Arabic: ولد الزنا) as this seems to be the main focus of your question.
This answer is based on a study done by Ibrahim ibn 'Abdullah ibn Salih al-Qussayyir as part of his master's thesis (full text here, Arabic only).
Stance
There is an agreement among scholars that children born out of wedlock:
- are Muslims, and
- do not bear the consequences of the fault of their parents.
In other words, they have all the rights and duties as any other Muslim. The fact that they are Muslims is based on:
ادْعُوهُمْ لِآبَائِهِمْ هُوَ أَقْسَطُ عِندَ اللَّهِ فَإِن لَّمْ تَعْلَمُوا آبَاءَهُمْ فَإِخْوَانُكُمْ فِي الدِّينِ وَمَوَالِيكُمْ وَلَيْسَ عَلَيْكُمْ جُنَاحٌ فِيمَا أَخْطَأْتُم بِهِ وَلَٰكِن مَّا تَعَمَّدَتْ قُلُوبُكُمْ وَكَانَ اللَّهُ غَفُورًا رَّحِيمًا
Call them by [the names of] their fathersـ it is more just in the sight of Allah.But if you do not know their fathers - then they are [still] your brothers in religion and those entrusted to you.And there is no blame upon you for that in which you have erred but [only for] what your hearts intended.And ever is Allah Forgiving and Merciful.
— Surat Al-Ahzab 33:5
The verse declares their stance as that of brotherhood in Islam, and loyalty. The brotherhood in Islam means (i) they are considered Muslims (the use of the word ennama
[Arabic: إنما] in Surat al-Hujurat 49:10 is an instrument of exclusivity in the Arabic language), (ii) with all the rights and (iii) duties of any other Muslim.
The Prophet ﷺ stipulated that those born out of wedlock are not to be treated any differently as consequence of the sin that their parents committed as per the hadith narrated on the authority of 'Aa'isha (Muhammad Nasiruddin al-Albani ruled it as a Hadith Hassan in As-Silsila As-Sahīha Vol. 5, pp. 218):
ولقوله صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: ولد الزنا ليس عليه من إثم أبويه شيء ـ وَلَا تَزِرُ وَازِرَةٌ وِزْرَ أُخْرَىٰ
— NOTE: My own translation, so treat with care:
The Prophet ﷺ said: "The child of adultery does not bear the sin of his parents; 'and no bearer of burdens will bear the burden of another.'"
— At-Tabarāni through 'Aa'isha
Nursing
The period of nursing is defined as two years based on Qur'an 2:233 (partially quoted):
وَالْوَالِدَاتُ يُرْضِعْنَ أَوْلَادَهُنَّ حَوْلَيْنِ كَامِلَيْنِ لِمَنْ أَرَادَ أَن يُتِمَّ الرَّضَاعَةَ وَعَلَى الْمَوْلُودِ لَهُ رِزْقُهُنَّ وَكِسْوَتُهُنَّ بِالْمَعْرُوفِ
Mothers may breastfeed their children two complete years for whoever wishes to complete the nursing [period]. Upon the father are the mothers' provision and their clothing according to what is acceptable.
— Surat Al-Baqarah 2:233
The four major schools of jurisprudence agree that:
- the mother bears the task of nursing, and
- the father bears the financial responsibility of the nursing period for both the mother and the child.
The mother's punishment is delayed till she delivers, and the child is weaned. This is based on the hadith of Ma'iz ibn Malik al-Aslami (partially quoted):
وَإِنَّهُ رَدَّهَا فَلَمَّا كَانَ الْغَدُ قَالَتْ يَا رَسُولَ اللَّهِ لِمَ تَرُدُّنِي لَعَلَّكَ أَنْ تَرُدَّنِي كَمَا رَدَدْتَ مَاعِزًا فَوَاللَّهِ إِنِّي لَحُبْلَى. قَالَ «إِمَّا لاَ فَاذْهَبِي حَتَّى تَلِدِي». فَلَمَّا وَلَدَتْ أَتَتْهُ بِالصَّبِيِّ فِي خِرْقَةٍ قَالَتْ هَذَا قَدْ وَلَدْتُهُ. قَالَ «اذْهَبِي فَأَرْضِعِيهِ حَتَّى تَفْطِمِيهِ». فَلَمَّا فَطَمَتْهُ أَتَتْهُ بِالصَّبِيِّ فِي يَدِهِ كِسْرَةُ خُبْزٍ فَقَالَتْ هَذَا يَا نَبِيَّ اللَّهِ قَدْ فَطَمْتُهُ وَقَدْ أَكَلَ الطَّعَامَ. فَدَفَعَ الصَّبِيَّ إِلَى رَجُلٍ مِنَ الْمُسْلِمِينَ ثُمَّ أَمَرَ بِهَا فَحُفِرَ لَهَا إِلَى صَدْرِهَا وَأَمَرَ النَّاسَ فَرَجَمُوهَا
On the following day she said: "Allah's Messenger, why do you turn me away? Perhaps, you turn me away as you turned away Ma'iz. By Allah, I have become pregnant." He said: "Well, if you insist upon it, then go away until you give birth [to the child]." When she delivered, she came with the child [wrapped] in a rag and said: "Here is the child whom I have given birth to." He said: "Go and suckle him until you wean him." When she had weaned him, she came to him with the child with a piece of bread in his hand. She said: "Allah's Apostle, here is he as I have weaned him and he eats food." The Prophet entrusted the child to one of the Muslims, then pronounced her punishment: she was put in a ditch up to her chest and he commanded people to stone her.
— Sahih Muslim, Book 29, Hadith 35
The financial responsibility of the father is based on Qur'an 2:233 quoted above ("upon the father is the mothers' provision and their clothing according to what is acceptable").
If the mother cannot nurse, then the father is obliged to (and can be forced to) pay for a nursing substitute during the nursing period. If the father is unable to provide, the responsibility of financial support goes to his heirs. This is based on Qur'an 2:233 again (partially quoted):
وَعَلَى الْوَارِثِ مِثْلُ ذَٰلِكَ
And upon the [father's] heir is [a duty] like that [of the father].
— Surat Al-Baqarah 2:233
For more details, refer to:
- Hanafi: Al-Jawhara al-Nayyira (Arabic: الجوهرة النيرة على مختصر القدوري) by Abu Bakr al-Zubaidi (Arabic: أبو بكر الزبِيدِى) in Vol. 2, pp. 152-159.
- Maliki: Mawāhib al-Jalīl (Arabic: مواهب الجليل لشرح مختصر خليل) by Abi 'Abdullah al-Maghrabi (Arabic: ابو عبدالله المغربى) in Vol. 5, pp. 541-580.
- Shafi'i: Asna al-Matālib (Arabic: أسنى المطالب في شرح روض الطالب) by Zakariyya al-Ansāri (Arabic: زكريا بن محمد بن زكريا الأنصارى) in Vol. 3, pp. 444-445.
- Hanbali: Matālib Uli al-Nahy (Arabic: مطالب أولي النهى في شرح غاية المنتهى) by Al-Ruhaibāni (Arabic: الرحيبانى)
in Vol. 5, pp. 653-662.
Custody
The general collective definition of custody is the protection and rightful upbringing of the child until independence. The four schools of jurisprudence have varying definitions:
- Hanafi: According to the gloss of Ibn 'Abidin Vol. 3, pp. 555-556, custody is "upbringing of the child" (Arabic: تربية الولد لمن له حق الحضانة).
- Maliki: According to Al-Mawwāq (Arabic: أبو عبد الله المواق) in Al-Tāj wa al-Iklīl (Arabic: التاج والإكليل لمختصر خليل) Vol. 5, pp. 594, he defined custody as "protecting the child through a home, food, dress, bed, and cleaning his body" (Arabic: حفظ الولد في مبيته ومؤنة طعامه ولباسه ومضجعه وتنظيف جسده).
- Shafi'i: According to Al-Ramli (Arabic: شمس الدين محمد الرملي) in Nehāyat al-Muhtāj (Arabic: نهاية المحتاج إلى شرح المنهاج) Vol. 7, pp. 225, the definition of custody is "to protect who is dependent, to raise him with what is beneficial, and to save him from what is harmful" (Arabic: حفظ من لا يستقل بأموره وتربيته بما يصلحه ويقيه عما يضره).
- Hanbali: In Al-Insāf (Arabic: الإنصاف في معرفة الراجح من الخلاف) by Al-Mardawi (Arabic: علاء الدين المرداوى) Vol. 9, pp. 416, custody is defined as "protecting the dependent until independence is reached" (Arabic: حفظ من لا يستقل بأموره وتربيته حتى يستقل بنفسه).
The custody during the nursing period goes to the mother:
المرأة أحق بولدها ما لم تزوج
— NOTE: My own translation, so treat with care:
A woman is entitled to her son unless she gets married.
— As-Silsila As-Sahīha Vol. 1, pp. 709
'Umar ibn Al-Khattab followed suit during his caliphate:
عَنِ ابْنِ عُمَرَ رضى الله عنهما أَنَّ رَجُلاً لاَعَنَ امْرَأَتَهُ فِي زَمَنِ النَّبِيِّ صلى الله عليه وسلم وَانْتَفَى مِنْ وَلَدِهَا فَفَرَّقَ النَّبِيُّ صلى الله عليه وسلم بَيْنَهُمَا وَأَلْحَقَ الْوَلَدَ بِالْمَرْأَةِ
Narrated Ibn 'Umar: A man and his wife had a case of Lian (or Mula'ana) during the lifetime of the Prophet (ﷺ) and the man denied the paternity of her child. The Prophet (ﷺ) gave his verdict for their separation (divorce) and then the child was regarded as belonging to the wife only.
— Sahih al-Bukhari, Book 85, Hadith 25
Once the mother's punishment takes place after the child is weaned, based on the hadith of Ma'iz ibn Malik al-Aslami (partially quoted), the custody goes to one of the Muslims to bring as an orphan:
فَدَفَعَ الصَّبِيَّ إِلَى رَجُلٍ مِنَ الْمُسْلِمِينَ ثُمَّ أَمَرَ بِهَا فَحُفِرَ لَهَا إِلَى صَدْرِهَا وَأَمَرَ النَّاسَ فَرَجَمُوهَا
The Prophet entrusted the child to one of the Muslims, then pronounced her punishment: she was put in a ditch up to her chest and he commanded people to stone her.
— Sahih Muslim, Book 29, Hadith 35
In case the mother is unable to act as a custodian or gets disqualified, the custody goes to the following child's relations:
- Hanafi: Maternal grandmother » sister (from the same mother) » sister's daughter » maternal aunt » brother's daughter » mother's maternal aunt » mother's paternal aunt (see Badā'e' al-Sanā'e' Vol. 4, pp. 41-42.
- Maliki: Maternal grandmother » maternal aunt » mother's maternal aunt » mother's paternal aunt » sister (from the same mother) » sister's daughter or brother's daughter (see Al-Tāj wa al-Iklīl Vol. 5, pp. 593).
- Shafi'i: Maternal grandmother » sister (from the same mother) » maternal aunt » sister's daughter » brother's daughter » maternal cousin » mother's maternal aunt (see Asna al-Matālib Vol. 3, pp. 451)
- Hanbali: Maternal grandmother » sister (from the same mother) » maternal aunt » mother's maternal aunt » brother's daughter » sister's daughter (see Al-Insāf Vol. 9, pp. 416)
All sister's relations have to be from the same mother as the child.
Inheritance
This is a very sophisticated matter to delve into and has to be treated on a case-by-case basis. The general governing rule is that the child inherits the mother, but not the father, based on the story of the son of Zam'a's slave girl:
عَنْ عَائِشَةَ ـ رضى الله عنها ـ أَنَّ عَبْدَ بْنَ زَمْعَةَ، وَسَعْدَ بْنَ أَبِي وَقَّاصٍ، اخْتَصَمَا إِلَى النَّبِيِّ صلى الله عليه وسلم فِي ابْنِ أَمَةِ زَمْعَةَ فَقَالَ سَعْدٌ يَا رَسُولَ اللَّهِ أَوْصَانِي أَخِي إِذَا قَدِمْتُ أَنْ أَنْظُرَ ابْنَ أَمَةِ زَمْعَةَ فَأَقْبِضَهُ، فَإِنَّهُ ابْنِي. وَقَالَ عَبْدُ بْنُ زَمْعَةَ أَخِي وَابْنُ أَمَةِ أَبِي، وُلِدَ عَلَى فِرَاشِ أَبِي. فَرَأَى النَّبِيُّ صلى الله عليه وسلم شَبَهًا بَيِّنًا فَقَالَ: هُوَ لَكَ يَا عَبْدُ بْنَ زَمْعَةَ، الْوَلَدُ لِلْفِرَاشِ، وَاحْتَجِبِي مِنْهُ يَا سَوْدَةُ
Narrated Aisha: Abu bin Zam'a and Sa'd bin Abi Waqqas carried the case of their claim of the (ownership) of the son of a slave-girl of Zam'a before the Prophet. Sa'd said, "O Allah's Messenger (ﷺ)! My brother, before his death, told me that when I would return (to Mecca), I should search for the son of the slave-girl of Zam'a and take him into my custody as he was his son." Abu bin Zam'a said, "this is my brother and the son of the slave-girl of my father, and was born of my father's bed." The Prophet (ﷺ) noticed a resemblance between 'Utba and the boy but he said, "O Abu bin Zam'a! You will get this boy, as the son goes to the owner of the bed. You, Sauda, screen yourself from the boy."
— Sahih al-Bukhari, Book 44, Hadith 11
There are differences depending on the school of jurisprudence and context, e.g., what Ibn Taymiyyah said in one of his fatwas that there are two opinions to those of knowledge about attributing the child to his father or to the adulterer depending on the context (see Sunan Ibn Majah, Book 23, Hadith 2851 for an example). Therefore, in the matter of inheritance, it is strongly advised to seek a fatwa from a qualified scholar.