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.
لَمَّا صَالَحَ رَسُولُ اللَّهِ ﷺ أَهْلَ الْحُدَيْبِيَةِ كَتَبَ عَلِيٌّ بَيْنَهُمْ كِتَابًا فَكَتَبَ مُحَمَّدٌ رَسُولُ اللَّهِ ﷺ فَقَالَ الْمُشْرِكُونَ لاَ تَكْتُبْ مُحَمَّدٌ رَسُولُ اللَّهِ لَوْ كُنْتَ رَسُولاً لَمْ نُقَاتِلْكَ فَقَالَ لِعَلِيٍّ امْحُهُ فَقَالَ عَلِيٌّ مَا أَنَا بِالَّذِي أَمْحَاهُ فَمَحَاهُ رَسُولُ اللَّهِ ﷺ بِيَدِهِ وَصَالَحَهُمْ عَلَى أَنْ يَدْخُلَ هُوَ وَأَصْحَابُهُ ثَلاَثَةَ أَيَّامٍ وَلاَ يَدْخُلُوهَا إِلاَّ بِجُلُبَّانِ السِّلاَحِ فَسَأَلُوهُ مَا جُلُبَّانُ السِّلاَحِ فَقَالَ الْقِرَابُ بِمَا فِيهِ