Mishkat al-Masabih 117
عَن عَليّ رَضِي الله عَنهُ قَالَ سَأَلت خَدِيجَة النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ عَنْ وَلَدَيْنِ مَاتَا لَهَا فِي الْجَاهِلِيَّةِ فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: هُمَا فِي النَّارِ قَالَ فَلَمَّا رأى الْكَرَاهِيَة فِي وَجْهِهَا قَالَ لَوْ رَأَيْتِ مَكَانَهُمَا لَأَبْغَضْتِهِمَا قَالَتْ يَا رَسُولَ اللَّهِ فَوَلَدِي مِنْكَ قَالَ فِي الْجنَّة قَالَ ثُمَّ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِنَّ الْمُؤْمِنِينَ وَأَوْلَادَهُمْ فِي الْجَنَّةِ وَإِنَّ الْمُشْرِكِينَ وَأَوْلَادَهُمْ فِي النَّارِ ثُمَّ قَرَأَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ (وَالَّذِينَ آمَنُوا وَاتَّبَعَتْهُمْ ذُرِّيَّتُهُمْ بِإِيمَانٍ أَلْحَقْنَا بِهِمْ ذرياتهم)
From ʿAli, may Allah be pleased with him, who said: Khadijah asked the Prophet ﷺ about two children of hers who had died in the Jahiliyyah. The Messenger of Allah ﷺ said: "They are in the Fire." He said: When he saw the displeasure in her face, he said: "If you saw their place, you would hate them." She said: "O Messenger of Allah, then my child from you?" He said: "In Paradise." He said: Then the Messenger of Allah ﷺ said: "The believers and their children are in Paradise, and the idolaters and their children are in the Fire." Then the Messenger of Allah ﷺ recited: 'And those who believed and whose offspring followed them in faith, We will join their offspring with them'.