When Messenger of Allah ﷺ concluded a peace treaty with the people of Hudaibiya, ʿAli bin Abu Talib wrote the document and he mentioned in it, "Muhammad, Messenger of Allah ﷺ ." The pagans said, "Don't write: 'Muhammad, Messenger of Allah ﷺ', for if you were an apostle we would not fight with you." Allah's Apostle asked ʿAli to rub it out, but ʿAli said, "I will not be the person to rub it out." Messenger of Allah ﷺ rubbed it out and made peace with them on the condition that the Prophet ﷺ and his companions would enter Mecca and stay there for three days, and that they would enter with their weapons in cases. (Using translation from Bukhārī 2698)
لَمَّا صَالَحَ رَسُولُ اللهِ ﷺ أَهْلَ الْحُدَيْبِيَةِ وَقَالَ ابْنُ بَشَّارٍ «أَهْلَ مَكَّةَ كَتَبَ عَلِيٌّ كِتَابًا بَيْنَهُمْ» قَالَ فَكَتَبَ مُحَمَّدٌ رَسُولُ اللهِ فَقَالَ الْمُشْرِكُونَ «لَا تَكْتُبْ مُحَمَّدٌ رَسُولُ اللهِ لَوْ كُنْتَ رَسُولَ اللهِ لَمْ نُقَاتِلْكَ» قَالَ «عَلِيٌّ امْحُهُ» قَالَ «مَا أَنَا بِالَّذِي أَمْحَاهُ فَمَحَاهُ رَسُولُ اللهِ ﷺ بِيَدِهِ فَصَالَحَهُمْ عَلَى أَنْ يَدْخُلَ هُوَ وَأَصْحَابُهُ ثَلَاثَةَ أَيَّامٍ وَلَا يَدْخُلُهَا إِلَّا بِجُلُبَّانِ السِّلَاحِ» فَسَأَلْتُهُ قَالَ ابْنُ بَشَّارٍ «فَسَأَلُوهُ مَا جُلُبَّانُ السِّلَاحِ؟» قَالَ «الْقِرَابُ بِمَا فِيهِ»