Sahih Muslim | Book 19 | Hadith Number 4403

Narrated by It has been narrated on the authority of Bara' who
It has been narrated on the authority of Bara' who said: When the Prophet (may peace be upon him) was checked from going to the Ka'ba, the people of Mecca made peace with him on the condition that he would (be allowed to) enter Mecca (next year) and stay there for three days, that he would not enter (the city) except with swords in their sheaths and arms encased in their covers, that he would not take away with him anyone from its dwellers, nor would he prevent anyone from those with him to stay on in Mecca (if he so desired). He said to 'Ali: Write down the terms settled between us. (So 'Ali wrote): In the name of Allah, most Gracious and most Merciful. This is what Muhammad, the Messenger of Allah, has settled (with the Meccans), The polytheists said to him: If we knew that thou art the Messenger of Allah, we would follow you. But write: Muhammad b. 'Abdullah. So he told 'Ali to strike out these words. 'Ali said: No, by Allah, I will not strike them out. The Messenger of Allah (may Peace be upon him) said: Show me their place (on the parchment). So he ('Ali) showed him their place and he (the Holy Prophet) struck them out; and 'Ali wrote: Ibn 'Abdullah. (According to the terms of the treaty, next year) the Holy Prophet (may peace be upon him) stayed there for three days When it was the third day, they said to 'Ali: This is the last day according to the terms of your companion. So tell him to leave. 'Ali informed the Prophet (may peace be upon him) accordingly. He said: Yes, and left (the city). Ibn Janab in his version of the tradition used: "we would swear allegiance to you" instead of "we would follow you".