The freed slave of Umar bin Ubaydullah, meaning Ibn Muamar, who was his scribe, reported that Abdullah bin Abu Awfa wrote to him when he marched out against the Haruriyyah, informing him that the Messenger of Allah ﷺ, on one of the days when he met the enemy, said, "People, do not wish to meet the enemy. Ask Allah the Exalted for safety. But when you do meet them, stand firm, and know that paradise lies beneath the shade of swords."Then he said, "Allah, Revealer of the Book, Mover of the clouds, Defeater of the confederates, defeat them and grant us victory over them."
حدثنا أبو صالح محبوب بن موسى أخبرنا أبو إسحق الفزاري عن موسى بن عقبة
مولى عمر بن عبيد الله يعني ابن معمر وكان كاتبا له قال كتب إليه عبد الله بن أبي أوفى حين خرج إلى الحرورية أن رسول الله ﷺ في بعض أيامه التي لقي فيها العدو قال يا أيها الناس لا تتمنوا لقاء العدو وسلوا الله تعالى العافية فإذا لقيتموهم فاصبروا واعلموا أن الجنة تحت ظلال السيوف ثم قال اللهم منزل الكتاب ومجري السحاب وهازم الأحزاب اهزمهم وانصرنا عليهم
Bukhari narrated it in the Book of Jihad and Expeditions, chapter "Do Not Wish to Encounter the Enemy," hadith no. 3024, from the hadith of Fazari. Muslim narrated it in the Book of Jihad and Expeditions, chapter "The Dislike of Wishing to Encounter the Enemy and the Command to Be Patient at the Time of Encounter," hadith no. 1742, from the hadith of Musa bin Uqba, with the same chain.