Short answer
It is one of the heaviest trials, and Allah promises great reward for it. The Prophet ﷺ said that parents who lose young children and bear it with patience will be shielded from the Fire and entered into Paradise by Allah's mercy. He himself lost children and wept for them.
Grief and tears for a child are permitted, while wailing and words of objection to Allah's decree are not. Children of Muslims who die young are in Paradise by the agreement of the scholars, and patience over their loss carries a promised reward. A baby who showed signs of life is washed, named and prayed over.
The four schools agree on this.
Explanation
If you have lost a child, a baby or a pregnancy, nothing written here will take the pain away. But it may help to know that the Prophet ﷺ walked this road before you. He buried all his children except Fatimah. When his baby son Ibrahim died in his arms, he wept and said: "The eye weeps and the heart grieves, and we say only what pleases our Lord. We are saddened by your parting, O Ibrahim."
What Allah has promised.
- The Prophet ﷺ said that any Muslim who loses three children before they reach adulthood will be entered into Paradise by Allah's mercy to those children.
- He told a group of women that a mother who loses three children and seeks reward will enter Paradise. A woman asked, "And two?" He said, "And two."
- Children of Muslims who die young are in Paradise, in Allah's care. They do not need your forgiveness; you can still pray for yourself and give charity in their name.
What patience means. It does not mean not crying or not missing them. It means not turning against Allah. Tears, sleepless nights and returning grief years later are human. Say Inna lillahi wa inna ilayhi raji'un, and the dua the Prophet ﷺ taught: "O Allah, reward me in my loss and give me something better."
Practical rulings. A baby who breathed or moved after birth is washed, named, prayed over and buried; a stillborn baby is washed, named and buried. See janazah for a stillborn baby. Do not let anyone blame you or your faith. If grief becomes depression, seeking help is part of caring for yourself; see dealing with grief.
The evidence
Quran, Surah Al-Baqara 2:155
وَلَنَبْلُوَنَّكُم بِشَىْءٍۢ مِّنَ ٱلْخَوْفِ وَٱلْجُوعِ وَنَقْصٍۢ مِّنَ ٱلْأَمْوَٰلِ وَٱلْأَنفُسِ وَٱلثَّمَرَٰتِ ۗ وَبَشِّرِ ٱلصَّٰبِرِينَ ﴿١٥٥﴾
And We will surely test you with something of fear and hunger and a loss of wealth and lives and fruits, but give good tidings to the patient,
Loss of loved ones is a test, with good news for the patient.
Quran, Surah Al-Baqara 2:157
أُو۟لَٰٓئِكَ عَلَيْهِمْ صَلَوَٰتٌۭ مِّن رَّبِّهِمْ وَرَحْمَةٌۭ ۖ وَأُو۟لَٰٓئِكَ هُمُ ٱلْمُهْتَدُونَ ﴿١٥٧﴾
Those are the ones upon whom are blessings from their Lord and mercy. And it is those who are the [rightly] guided.
Those who are patient receive blessings and mercy.
Sahih al-Bukhari 1248
Sahih... لم يبلغوا الحنث إلا أدخله الله الجنة بفضل رحمته إياهم ...
"No Muslim has three children die before reaching adulthood except that Allah enters him into Paradise by His mercy to them."
Promised reward for parents who lose children.
Sahih Muslim 2632
Sahih... لا يموت لإحداكن ثلاثة من الولد فتحتسبه ...
"None of you loses three children and seeks reward with Allah except that she enters Paradise. A woman asked: Or two, O Messenger of Allah? He said: Or two."
The promise includes losing two children.
Sahih al-Bukhari 1303
Sahih... إن العين تدمع والقلب يحزن ...
"The eye weeps and the heart grieves."
The Prophet ﷺ wept for his son, so tears are not a lack of faith.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, Bab Salat al-Janazah. Washing, naming and praying over a child who showed signs of life.
- al-Hidaya, Kitab al-Salah, Bab al-Jana'iz. The ruling on the stillborn and the baby who cried at birth.
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.