Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) narrates: On the occasion of the Battle of Khaybar, the Prophet (peace and blessings be upon him) sent a man, and he gave way to cowardice. Then Sayyiduna Muhammad bin Maslamah (may Allah be pleased with him) came and said: "O Messenger of Allah! I have never seen a day like today. Mahmud bin Maslamah has been killed." The Prophet (peace and blessings be upon him) said: "Do not wish to meet the enemy; ask Allah Almighty for well-being, for you do not know what you may be tested with through them. And when you meet the enemy, say: 'O Allah, You are our Lord and their Lord; our forelocks and their forelocks are in Your hand; it is You alone who (grants the strength) to fight them.' Then sit down on the ground, and if the enemy comes upon you, rise up saying the takbir." Then the Prophet (peace and blessings be upon him) said: "Tomorrow I will send a man who loves Allah and His Messenger, and they both love him; he will not turn his back." When the next day came, the Prophet (peace and blessings be upon him) called Sayyiduna Ali (may Allah be pleased with him), who was suffering from a severe eye inflammation. The Prophet (peace and blessings be upon him) said: "Set off." He said: "O Messenger of Allah! I cannot even see where my feet are placed." The narrator says: So the Prophet (peace and blessings be upon him) applied his saliva to his eyes, tied the banner for him and handed the flag to him. Sayyiduna Ali (may Allah be pleased with him) said: "O Messenger of Allah! On what basis shall I fight these people?" The Prophet (peace and blessings be upon him) said: "On the basis that they bear witness that there is no god but Allah and that I am the Messenger of Allah. When they do that, they will have protected their lives and their wealth, except for what is due by its right, and their reckoning will rest with Allah Almighty."
Al-Tabarani recorded it in al-Mu'jam al-Saghir. Its chain contains a narrator, al-Khalil bin Murrah; Abu Zur'ah said he is a righteous elder, while a group declared him da'if (weak). (Allamah al-Haythami says:) I say: the other hadiths on this subject will come later in the chapter on the virtues of Sayyiduna Ali (may Allah be pleased with him).