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.
ahmad:1370Zakariyyā b. ʿAdī > ʿUbaydullāh b. ʿAmr > ʿAbdullāh b. Muḥammad b. ʿAqīl > Muḥammad b. ʿAliyyʿan ʿAlī

When al-Hasan was born, I named him Hamzah. When al-Husain was born, I named him after his paternal uncle Jaʿfar. Then the Messenger of Allah ﷺ called me and said: ʿI have been commanded to change the names of these two.ʿ I said: Allah and His Messenger know best. And he named them Hasan and Husain. ؓ   

أحمد:١٣٧٠حَدَّثَنَا زَكَرِيَّا بْنُ عَدِيٍّ أَنْبَأَنَا عُبَيْدُ اللهِ بْنُ عَمْرٍو عَنْ عَبْدِ اللهِ بْنِ مُحَمَّدِ بْنِ عَقِيلٍ عَنْ مُحَمَّدِ بْنِ عَلِيٍّعَنْ عَلِيٍّ قَالَ

لَمَّا وُلِدَ الْحَسَنُ سَمَّاهُ حَمْزَةَ فَلَمَّا وُلِدَ الْحُسَيْنُ سَمَّاهُ بِعَمِّهِ جَعْفَرٍ قَالَ فَدَعَانِي رَسُولُ اللهِ ﷺ فَقَالَ إِنِّي أُمِرْتُ أَنْ أُغَيِّرَ اسْمَ هَذَيْنِ فَقُلْتُ اللهُ وَرَسُولُهُ أَعْلَمُ فَسَمَّاهُمَا حَسَنًا وَحُسَيْنًا  


See similar narrations below:

Collected by Ḥākim
hakim:7734Abū Bakr Aḥmad b. Salmān al-Faqīh> Hilāl b. al-ʿAlāʾ al-Raqqī from my father > ʿUbaydullāh b. ʿAmr > ʿAbdullāh b. Muḥammad b. ʿAqīl from his father > ʿAlī

[Machine] "He named his eldest son after his uncle, Hamza, and he named Hussain after his uncle, Jafar. The Messenger of Allah ﷺ called Ali and said, 'I have been commanded to change the names of these two.' Allah and His Messenger know best, so he named them Hasan and Hussain."  

الحاكم:٧٧٣٤أَخْبَرَنَا أَبُو بَكْرٍ أَحْمَدُ بْنُ سَلْمَانَ الْفَقِيهُ بِبَغْدَادَ ثَنَا هِلَالُ بْنُ الْعَلَاءِ الرَّقِّيُّ ثَنَا أَبِي ثَنَا عُبَيْدُ اللَّهِ بْنُ عَمْرٍو عَنْ عَبْدِ اللَّهِ بْنِ مُحَمَّدِ بْنِ عَقِيلٍ عَنْ أَبِيهِ عَنْ عَلِيٍّ

أَنَّهُ سَمَّى ابْنَهُ الْأَكْبَرَ بِاسْمِ عَمِّهِ حَمْزَةَ وَسَمَّى حُسَيْنًا بِعَمِّهِ جَعْفَرٍ فَدَعَا رَسُولُ اللَّهِ ﷺ عَلِيًّا فَقَالَ «إِنِّي قَدْ أَمَرْتُ أَنْ أُغَيِّرَ اسْمَ هَذَيْنِ» فَقَالَ اللَّهُ وَرَسُولُهُ أَعْلَمُ فَسَمَّاهُمَا حَسَنًا وَحُسَيْنًا  

«هَذَا حَدِيثٌ صَحِيحُ الْإِسْنَادِ وَلَمْ يُخَرِّجَاهُ»