Short answer
In the Hanafi school the mother has first right to raise young children: a boy until about seven and a girl until about nine, after which the father takes over their upbringing. The father pays for them throughout. A mother can lose custody by marrying a man who is not a close relative of the child, and the child's welfare is the guiding aim. The schools differ on the ages.
Custody of a young child (hadanah) belongs first to the mother, then her mother, then the father's mother, then sisters and aunts. It ends for a boy at about seven, when he can manage his own basic needs, and for a girl at nine according to the fatwa, after which the father takes custody. The mother loses it if she marries a man who is not a mahram of the child, or if she is unfit.
Other madhhabs
- Shafi'i
- At about seven the child, boy or girl, chooses which parent to live with.
- Maliki
- The mother keeps a boy until puberty and a girl until she marries.
- Hanbali
- At seven a boy chooses which parent to live with, and a girl goes to her father.
Explanation
A divorced woman told the Prophet ﷺ that her body had been her son's vessel, her breast his drink and her lap his shelter, and that his father wanted to take him. He told her, "You have more right to him as long as you do not marry." Islam separates two things: custody (hadanah), which is daily care, and guardianship (wilayah), which covers decisions about schooling, religion, property and marriage and stays with the father.
The Hanafi order of custody:
- the mother;
- then the mother's mother;
- then the father's mother;
- then full sisters, then half-sisters, then aunts;
- then male relatives, starting with the father.
Conditions. The carer must be sane, trustworthy and able to look after the child. A mother who marries a man who is not a mahram of the child loses custody, and regains it if that marriage ends. A non-Muslim mother keeps custody of a young child unless there is a real risk to his religion. At the end of the custody age the child moves to the father, but judges may look at the child's welfare.
In practice. Both parents keep the right to see the child, and neither may use the child to hurt the other. The father pays all the child's costs, see child support. In Western countries courts decide on the child's best interests; Muslim parents can agree terms in line with these rules, often with help from an Islamic council. Every case turns on its facts, so ask a mufti.
Ask a mufti about your own case. This answer explains the general ruling. When the details of your situation matter, as they do here, ask a qualified mufti and give them the full facts. Where to ask a scholar.
The evidence
Quran, Surah Al-Baqara 2:233
۞ وَٱلْوَٰلِدَٰتُ يُرْضِعْنَ أَوْلَٰدَهُنَّ حَوْلَيْنِ كَامِلَيْنِ ۖ لِمَنْ أَرَادَ أَن يُتِمَّ ٱلرَّضَاعَةَ ۚ وَعَلَى ٱلْمَوْلُودِ لَهُۥ رِزْقُهُنَّ وَكِسْوَتُهُنَّ بِٱلْمَعْرُوفِ ۚ لَا تُكَلَّفُ نَفْسٌ إِلَّا وُسْعَهَا ۚ لَا تُضَآرَّ وَٰلِدَةٌۢ بِوَلَدِهَا وَلَا مَوْلُودٌۭ لَّهُۥ بِوَلَدِهِۦ ۚ وَعَلَى ٱلْوَارِثِ مِثْلُ ذَٰلِكَ ۗ فَإِنْ أَرَادَا فِصَالًا عَن تَرَاضٍۢ مِّنْهُمَا وَتَشَاوُرٍۢ فَلَا جُنَاحَ عَلَيْهِمَا ۗ وَإِنْ أَرَدتُّمْ أَن تَسْتَرْضِعُوٓا۟ أَوْلَٰدَكُمْ فَلَا جُنَاحَ عَلَيْكُمْ إِذَا سَلَّمْتُم مَّآ ءَاتَيْتُم بِٱلْمَعْرُوفِ ۗ وَٱتَّقُوا۟ ٱللَّهَ وَٱعْلَمُوٓا۟ أَنَّ ٱللَّهَ بِمَا تَعْمَلُونَ بَصِيرٌۭ ﴿٢٣٣﴾
Mothers may breastfeed their children two complete years for whoever wishes to complete the nursing [period]. Upon the father is the mothers' provision and their clothing according to what is acceptable. No person is charged with more than his capacity. No mother should be harmed through her child, and no father through his child. And upon the [father's] heir is [a duty] like that [of the father]. And if they both desire weaning through mutual consent from both of them and consultation, there is no blame upon either of them. And if you wish to have your children nursed by a substitute, there is no blame upon you as long as you give payment according to what is acceptable. And fear Allah and know that Allah is Seeing of what you do.
Neither parent may use the child to harm the other.
Sunan Abi Dawud 2276
Grading to be checked... أنت أحق به ما لم تنكحي ...
"You have more right to him as long as you do not marry."
The mother has first right to custody of a young child.
Where the ruling is recorded
- al-Hidaya, Kitab al-Talaq, Bab al-Hadanah. The order of custodians and the ages at which custody ends.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Talaq, Bab al-Hadanah. The fatwa that a girl's custody ends at nine.
- Minhaj al-Talibin (Nawawi), Kitab al-Nafaqat, Fasl fi al-Hadanah. The Shafi'i rule that the child chooses at the age of discernment.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.