Bara bin Azib reported,

When the Prophet ﷺ performed Umrah in the month of Dhu al-Qadah, the people of Mecca refused to let him enter Mecca until he made an agreement with them that he would stay there for three days. When they wrote the document, they wrote, "This is what Muhammad, the Messenger of Allah, has agreed upon."They said, "We do not accept this from you. If we knew you were the Messenger of Allah, we would not have prevented you from anything. But you are Muhammad bin Abdullah."He replied, "I am the Messenger of Allah, and I am Muhammad bin Abdullah."Then he said to Ali bin Abu Talib رضي الله عنه, "Erase 'Messenger of Allah.'"Ali said, "No, by Allah, I will never erase you."So the Messenger of Allah ﷺ took the document, though he was not skilled in writing, and wrote, "This is what Muhammad bin Abdullah has agreed upon. No weapons may enter Mecca except a sword in its sheath. He may not take any of its people away with him if any wish to follow him, and he may not prevent any of his companions from staying there if they wish."When he entered the city and the agreed period had passed, they came to Ali and said, "Tell your companion to leave us, for the period has ended."So the Prophet ﷺ departed, and the daughter of Hamza followed him, calling out, "Uncle, uncle!" Ali took hold of her hand and said to Fatimah, peace be upon her, "Take your cousin." So she carried her.Then Ali, Zayd, and Jafar disputed over her.Ali said, "I took her, and she is my cousin."Jafar said, "She is my cousin, and her maternal aunt is my wife."Zayd said, "She is my brother's daughter."The Prophet ﷺ judged that she should go to her maternal aunt, saying, "The maternal aunt holds the position of the mother."He said to Ali, "You are from me and I am from you."He said to Jafar, "You resemble me in appearance and character."He said to Zayd, "You are our brother and our freedman."Ali said, "Will you not marry the daughter of Hamza?"He replied, "She is the daughter of my brother through breastfeeding."

Bukhari 4251

Sahih

حدثني عبيد الله بن موسى عن إسرائيل عن أبي إسحاق

عن البراء رضي الله عنه قال

لما اعتمر النبي ﷺ في ذي القعدة فأبى أهل مكة أن يدعوه يدخل مكة حتى قاضاهم على أن يقيم بها ثلاثة أيام فلما كتبوا الكتاب كتبوا هذا ما قاضى عليه محمد رسول الله قالوا لا نقر لك بهذا لو نعلم أنك رسول الله ما منعناك شيئا ولكن أنت محمد بن عبد الله فقال أنا رسول الله وأنا محمد بن عبد الله ثم قال لعلي بن أبي طالب رضي الله عنه امح رسول الله قال علي لا والله لا أمحوك أبدا فأخذ رسول الله ﷺ الكتاب وليس يحسن يكتب فكتب هذا ما قاضى عليه محمد بن عبد الله لا يدخل مكة السلاح إلا السيف في القراب وأن لا يخرج من أهلها بأحد إن أراد أن يتبعه وأن لا يمنع من أصحابه أحدا إن أراد أن يقيم بها فلما دخلها ومضى الأجل أتوا عليا فقالوا قل لصاحبك اخرج عنا فقد مضى الأجل فخرج النبي ﷺ فتبعته ابنة حمزة تنادي يا عم يا عم فتناولها علي فأخذ بيدها وقال لفاطمة عليها السلام دونك ابنة عمك حملتها فاختصم فيها علي وزيد وجعفر قال علي أنا أخذتها وهي بنت عمي وقال جعفر ابنة عمي وخالتها تحتي وقال زيد ابنة أخي فقضى بها النبي ﷺ لخالتها وقال الخالة بمنزلة الأم وقال لعلي أنت مني وأنا منك وقال لجعفر أشبهت خلقي وخلقي وقال لزيد أنت أخونا ومولانا وقال علي ألا تتزوج بنت حمزة قال إنها ابنة أخي من الرضاعة

البخاري 4251صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expeditions
Chapter
Amra of requital
Numbering
Darussalam 4251
Bukhari 4251