Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Tomorrow I shall give the banner to a man who loves Allah and His Messenger, and through whose hands Allah will grant victory."Umar said, "I never desired leadership except on that day."He continued, "I stretched myself up hoping to be called for it. But the Messenger of Allah ﷺ called Ali bin Abu Talib and handed it to him, saying, 'Go forward, and do not turn back until Allah grants you victory.'"Ali walked on for a while, then stopped without turning around and called out, "Messenger of Allah, on what basis shall I fight the people?"He replied, "Fight them until they bear witness that there is no god but Allah and that Muhammad is the Messenger of Allah. If they do that, they have protected their blood and property from you, except for what is due by right, and their reckoning is with Allah."

Azami 9043

Sahih

عن أبي هريرة قال

قال رسول الله ﷺ: لأعطين الراية غدا رجلا يحب الله ورسوله، يفتح الله على يديه قال عمر: ما أحببت الإمارة إلا يومئذ قال: فتساورت لها رجاء أن أدعى لها، قال: فدعا رسول الله ﷺ علي بن أبي طالب. فأعطاه إياها. وقال: امش، ولا تلتفت حتى يفتح الله عليك. قال: فسار علي شيئا ثم وقف ولم يلتفت، فصرخ: يا رسول الله! على ماذا أقاتل الناس؟ قال: قاتلهم حتى يشهدوا أن لا إله إلا الله وأن محمدا رسول الله، فإذا فعلوا ذلك فقد منعوا منك دماءهم وأموالهم إلا بحقها، وحسابهم على الله.

الأعظمي 9043صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Expedition of Khaybar
Section
Prophet ﷺ foretelling its conquest at the hands of Ali bin Abu Talib
Numbering
Jami al-Kamil 9043 (2nd edition)
Azami 9043