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.
muslim:1805dMuḥammad b. Ḥātim > Bahz > Ḥammād b. Salamah > Thābit > Anas

We are those who have sworn allegiance to Muhammad (And made a covenant with him) to follow Islam as long as we live. Hammad is not sure whether Anas said:" Ala'l-Islam" or," Ala'l-Jihad". And the Prophet ﷺ was chanting: O God, the real good is the good of the Hereafter, So forgive Thou the Ansar and the Muhajirs.  

مسلم:١٨٠٥dحَدَّثَنِي مُحَمَّدُ بْنُ حَاتِمٍ حَدَّثَنَا بَهْزٌ حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ حَدَّثَنَا ثَابِتٌ عَنْ أَنَسٍ

أَنَّ أَصْحَابَ مُحَمَّدٍ ﷺ كَانُوا يَقُولُونَ يَوْمَ الْخَنْدَقِ نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدًا عَلَى الإِسْلاَمِ مَا بَقِينَا أَبَدًا أَوْ قَالَ عَلَى الْجِهَادِ شَكَّ حَمَّادٌ وَالنَّبِيُّ ﷺ يَقُولُ اللَّهُمَّ إِنَّ الْخَيْرَ خَيْرُ الآخِرَهْ فَاغْفِرْ لِلأَنْصَارِ وَالْمُهَاجِرَهْ  


See similar narrations below:

Collected by Bukhārī, Aḥmad, Nasāʾī's Kubrá
bukhari:2835Abū Maʿmar > ʿAbd al-Wārith > ʿAbd al-ʿAzīz > Anas

The Emigrants and the Ansar started digging the trench around Medina carrying the earth on their backs and saying, "We are those who have given a pledge of allegiance to Muhammad that we will I carry on Jihad as long as we live." The Prophet ﷺ kept on replying, "O Allah, there is no good except the good of the Hereafter; so confer Your Blessings on the Ansar and the Emigrants."  

البخاري:٢٨٣٥حَدَّثَنَا أَبُو مَعْمَرٍ حَدَّثَنَا عَبْدُ الْوَارِثِ حَدَّثَنَا عَبْدُ الْعَزِيزِ عَنْ أَنَسٍ ؓ قَالَ

جَعَلَ الْمُهَاجِرُونَ وَالأَنْصَارُ يَحْفِرُونَ الْخَنْدَقَ حَوْلَ الْمَدِينَةِ وَيَنْقُلُونَ التُّرَابَ عَلَى مُتُونِهِمْ وَيَقُولُونَ نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدًا عَلَى الإِسْلاَمِ مَا بَقِينَا أَبَدًا وَالنَّبِيُّ ﷺ يُجِيبُهُمْ وَيَقُولُ اللَّهُمَّ إِنَّهُ لاَ خَيْرَ إِلاَّ خَيْرُ الآخِرَهْ فَبَارِكْ فِي الأَنْصَارِ وَالْمُهَاجِرَهْ  

bukhari:7201ʿAmr b. ʿAlī > Khālid b. al-Ḥārith > Ḥumayd > Anas

The Prophet ﷺ went out on a cold morning while the Muhajirin (emigrants) and the Ansar were digging the trench. The Prophet ﷺ then said, "O Allah! The real goodness is the goodness of the Here after, so please forgive the Ansar and the Muhajirin." They replied, "We are those who have given the Pledge of allegiance to Muhammad for to observe Jihad as long as we remain alive."  

البخاري:٧٢٠١حَدَّثَنَا عَمْرُو بْنُ عَلِيٍّ حَدَّثَنَا خَالِدُ بْنُ الْحَارِثِ حَدَّثَنَا حُمَيْدٌ

عَنْ أَنَسٍ ؓ خَرَجَ النَّبِيُّ ﷺ فِي غَدَاةٍ بَارِدَةٍ وَالْمُهَاجِرُونَ وَالأَنْصَارُ يَحْفِرُونَ الْخَنْدَقَ فَقَالَ اللَّهُمَّ إِنَّ الْخَيْرَ خَيْرُ الآخِرَهْ فَاغْفِرْ لِلأَنْصَارِ وَالْمُهَاجِرَهْ فَأَجَابُوا نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْجِهَادِ مَا بَقِينَا أَبَدَا  

ahmad:14068ʿAffān > Ḥammād > Thābit > Anas

[Machine] The companions of the Prophet ﷺ used to say while they were digging the trench: "We are those who pledged allegiance to Muhammad for Islam, and we will never retreat." And the Prophet ﷺ used to say: "O Allah, surely the kindest of favors is the favor of the Hereafter, so forgive the Ansar (helpers) and the Muhajirun (emigrants)." Then, the Messenger of Allah ﷺ would bring some barley bread and a dish of fat, and they would eat from it. And the Prophet ﷺ would say: "Indeed, the best goodness is the goodness of the Hereafter."  

أحمد:١٤٠٦٨حَدَّثَنَا عَفَّانُ حَدَّثَنَا حَمَّادٌ قَالَ أَخْبَرَنَا ثَابِتٌ عَنْ أَنَسٍ

أَنَّ أَصْحَابَ النَّبِيِّ ﷺ كَانُوا يَقُولُونَ وَهُمْ يَحْفِرُونَ الْخَنْدَقَ[البحر الرجز]نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْإِسْلَامِ مَا بَقِينَا أَبَدَاوَالنَّبِيُّ ﷺ يَقُولُاللهُمَّ إِنَّ الْخَيْرَ خَيْرُ الْآخِرَهْ فَاغْفِرْ لِلْأَنْصَارِ وَالْمُهَاجِرَهْفَأُتِيَ رَسُولُ اللهِ ﷺ بِخُبْزِ شَعِيرٍ وَإِهَالَةٍ سَنِخَةٍ فَأَكَلُوا مِنْهَا وَقَالَ النَّبِيُّ ﷺ إِنَّمَا الْخَيْرُ خَيْرُ الْآخِرَة  

ahmad:13646ʿAffān > Ḥammād > Thābit > Anas

[Machine] "The companions of the Prophet (PBUH) used to say while digging the trench: 'We are the ones who pledged allegiance to Muhammad on Islam, and we will never turn away.' And the Prophet (PBUH) used to say: 'O Allah, the goodness is the goodness of the hereafter, so forgive the Ansar and the Muhajirun.' And the Messenger of Allah (PBUH) brought a loaf of barley bread with crushed date on it, and they ate from it. And the Prophet (PBUH) said: 'Indeed, the goodness is the goodness of the hereafter.'"  

أحمد:١٣٦٤٦حَدَّثَنَا عَفَّانُ حَدَّثَنَا حَمَّادٌ قَالَ أَخْبَرَنَا ثَابِتٌ عَنْ أَنَسٍ

أَنَّ أَصْحَابَ النَّبِيِّ ﷺ كَانُوا يَقُولُونَ وَهُمْ يَحْفِرُونَ الْخَنْدَقَ[البحر الرجز]نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْإِسْلَامِ مَا بَقِينَا أَبَدَاوَالنَّبِيُّ ﷺ يَقُولُاللهُمَّ إِنَّ الْخَيْرَ خَيْرُ الْآخِرَهْ فَاغْفِرْ لِلْأَنْصَارِ وَالْمُهَاجِرَهْوَأُتِيَ رَسُولُ اللهِ ﷺ بِخُبْزِ شَعِيرٍ عَلَيْهِ إِهَالَةٌ سَنِخَةٌ فَأَكَلُوا مِنْهَا وَقَالَ النَّبِيُّ ﷺ إِنَّمَا الْخَيْرُ خَيْرُ الْآخِرَةِ  

ahmad:13127Ibn Abū ʿAdī > Ḥumayd > Anas

[Machine] The Messenger of Allah ﷺ and the immigrants went out to dig the trench on a cold morning. Anas narrated that they did not have servants, so the Messenger of Allah ﷺ said, "O Allah, indeed the good is only the good of the Hereafter, so forgive the Ansar and the Muhajireen." They responded, "We are the ones who pledged allegiance to Muhammad for jihad, we will never retreat."  

أحمد:١٣١٢٧حَدَّثَنَا ابْنُ أَبِي عَدِيٍّ عَنْ حُمَيْدٍ عَنْ أَنَسٍ قَالَ

خَرَجَ رَسُولُ اللهِ ﷺ وَالْمُهَاجِرُونَ يَحْفِرُونَ الْخَنْدَقَ فِي غَدَاةٍ بَارِدَةٍ قَالَ أَنَسٌ وَلَمْ يَكُنْ لَهُمْ خَدَمٌ فَقَالَ رَسُولُ اللهِ ﷺ اللهُمَّ إِنَّمَا الْخَيْرُ خَيْرُ الْآخِرَهْ فَاغْفِرْ لِلْأَنْصَارِ وَالْمُهَاجِرَهْ قَالَ فَأَجَابُوهُ[البحر الرجز]نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْجِهَادِ مَا بَقِينَا أَبَدَاأوْ لَا نَفِرُّ  

ahmad:12732Muḥammad b. Jaʿfar > Shuʿbah > Ḥumayd > Anas b. Mālik

[Machine] The Ansar said, "We are the ones who pledged allegiance to Muhammad for jihad, and we will never cease to exist." The Messenger of Allah ﷺ replied, "O Allah, the best is the best in the hereafter. So forgive the Ansar and the Muhajireen."  

أحمد:١٢٧٣٢حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ حَدَّثَنَا شُعْبَةُ عَنْ حُمَيْدٍ قَالَ سَمِعْتُ أَنَسَ بْنَ مَالِكٍ قَالَ

قَالَتِ الْأَنْصَارُ نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْجِهَادِ مَا بَقِينَا أَبَدَا فَأَجَابَهُمْ رَسُولُ اللهِ ﷺ اللهُمَّ إِنَّ الْخَيْرَ خَيْرُ الْآخِرَهْ فَاغْفِرْ لِلْأَنْصَارِ وَالْمُهَاجِرَهْ  

nasai-kubra:8808ʿAmr b. ʿAlī And Muḥammad b. al-Muthanná > Khālid > Ḥumayd > Anas

The Prophet ﷺ went out on a cold morning while the Muhajirin (emigrants) and the Ansar were digging the trench. The Prophet ﷺ then said, "O Allah! The real goodness is the goodness of the Here after, so please forgive the Ansar and the Muhajirin." They replied, "We are those who have given the Pledge of allegiance to Muhammad for to observe Jihad as long as we remain alive." (Using translation from Bukhārī 7201)   

الكبرى للنسائي:٨٨٠٨أَخْبَرَنَا عَمْرُو بْنُ عَلِيٍّ وَمُحَمَّدُ بْنُ الْمُثَنَّى عَنْ خَالِدٍ قَالَ حَدَّثَنَا حُمَيْدٌ عَنْ أَنَسٍ قَالَ

خَرَجَ النَّبِيُّ ﷺ فِي غَدَاةٍ بَارِدَةٍ وَالْمُهَاجِرُونَ وَالْأَنْصَارُ يَعْنِي يَحْفِرُونَ الْخَنْدَقَ فَقَالَ «اللهُمَّ إِنَّ الْخَيْرَ خَيْرُ الْآخِرَهْ فَاغْفِرْ لِلْأَنْصَارِ وَالْمُهَاجِرَهْ» فَأَجَابُوهُ [البحر الرجز] نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْجِهَادِ مَا بَقِينَا أَبَدَا  

nasai-kubra:8259Muḥammad b. al-Muthanná > Khālid > Ḥumayd > Anas

The Prophet ﷺ went out on a cold morning while the Muhajirin (emigrants) and the Ansar were digging the trench. The Prophet ﷺ then said, "O Allah! The real goodness is the goodness of the Here after, so please forgive the Ansar and the Muhajirin." They replied, "We are those who have given the Pledge of allegiance to Muhammad for to observe Jihad as long as we remain alive." (Using translation from Bukhārī 7201)   

الكبرى للنسائي:٨٢٥٩أَخْبَرَنَا مُحَمَّدُ بْنُ الْمُثَنَّى عَنْ خَالِدٍ قَالَ حَدَّثَنَا حُمَيْدٌ عَنْ أَنَسٍ قَالَ

خَرَجَ النَّبِيُّ ﷺ فِي غَدَاةٍ بَارِدَةٍ وَالْمُهَاجِرُونَ وَالْأَنْصَارُ يَحْفِرُونَ الْخَنْدَقَ فَقَالَ «اللهُمَّ إِنَّ الْخَيْرَ خَيْرُ الْآخِرَةِ فَاغْفِرْ لِلْأَنْصَارِ وَالْمُهَاجِرَةِ» فَأَجَابُوهُ [البحر الرجز] نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الْجِهَادِ مَا بَقِينَا أَبَدَا