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:3187ʿAbd al-Raḥman b. Mahdī > ʿIkrimah b. ʿAmmār > Abū Zumayl > ʿAbdullāh b. ʿAbbās

[Machine] When Al-Haruriya left, they isolated themselves. So I said to them, "Indeed, the Messenger of Allah ﷺ on the day of Hudaybiyah made a peace treaty with the polytheists." So Ali said, "Write, O Ali, this is what Muhammad, the Messenger of Allah, has agreed to." They said, "If we knew that you are the Messenger of Allah, we would not fight against you." So the Messenger of Allah ﷺ said, "Erase, O Ali. O Allah, You know that I am Your Messenger, so erase it, O Ali, and write, this is what Muhammad bin Abdullah has agreed to." By Allah, the Messenger of Allah is better than Ali, and he has erased himself, and his erasure does not remove his prophethood. Have I made clear to you?" They said, "Yes."  

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

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


See similar narrations below:

Collected by Nasāʾī's Kubrá
nasai-kubra:11747ʿAmr b. ʿAlī > Ibn Mahdī > ʿIkrimah b. ʿAmmār > Abū Zumayl Simāk b. al-Walīd > Ibn ʿAbbās > Nabī Allāh ﷺ Yawm al-Ḥudaybiyah Ṣālaḥ al-Mushrikīn

[Machine] That the Prophet of Allah ﷺ reconciled with the polytheists on the day of Hudaybiyah. He said to Ali, "Write, O Ali, this is what is agreed upon by Muhammad, the messenger of Allah." They said, "If we had known that you are the messenger of Allah, we would not have fought against you." The messenger of Allah ﷺ said, "Erase, O Ali, O Allah, You know that I am the messenger of Allah, erase, O Ali, and write, this is what is agreed upon by Muhammad ibn Abdullah, abbreviated, and it is an abbreviation of the Hadeeth of Al-Hururiyyah."  

الكبرى للنسائي:١١٧٤٧عَنْ عَمْرو بْنِ عَلِيٍّ عَنِ ابْنِ مَهْدِيٍّ عَنْ عِكْرِمَةَ بْنِ عَمَّارٍ عَنْ أَبِي زُمَيْلٍ سِمَاكِ بْنِ الْوَلِيدِ عَنِ ابْنِ عَبَّاسٍ

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