Sahih al-Bukhari, Hadith 2965

Narrated Salim Abu An-Nadr: The freed slave of `Umar bin 'Ubaidullah who was `Umar's clerk: `Abdullah bin Abi `Aufa wrote him (i.e. `Umar) a letter that contained the following:-- "Once Allah's Messenger (during a holy battle), waited till the sun had declined and then he got up among the people and said, "O people! Do not wish to face the enemy (in a battle) and ask Allah to save you (from calamities) but if you should face the enemy, then be patient and let it be known to you that Paradise is under the shades of swords." He then said,, "O Allah! The Revealer of the (Holy) Book, the Mover of the clouds, and Defeater of Al-Ahzab (i.e. the clans of infidels), defeat them infidels and bestow victory upon us."

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ، حَدَّثَنَا مُعَاوِيَةُ بْنُ عَمْرٍو، حَدَّثَنَا أَبُو إِسْحَاقَ، عَنْ مُوسَى بْنِ عُقْبَةَ، عَنْ سَالِمٍ أَبِي النَّضْرِ، مَوْلَى عُمَرَ بْنِ عُبَيْدِ اللَّهِ وَكَانَ كَاتِبًا لَهُ قَالَ كَتَبَ إِلَيْهِ عَبْدُ اللَّهِ بْنُ أَبِي أَوْفَى ـ رضى الله عنهما ـ فَقَرَأْتُهُ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم فِي بَعْضِ أَيَّامِهِ الَّتِي لَقِيَ فِيهَا انْتَظَرَ حَتَّى مَالَتِ الشَّمْسُ‏.‏ ثُمَّ قَامَ فِي النَّاسِ قَالَ ‏ "‏ أَيُّهَا النَّاسُ، لاَ تَتَمَنَّوْا لِقَاءَ الْعَدُوِّ، وَسَلُوا اللَّهَ الْعَافِيَةَ، فَإِذَا لَقِيتُمُوهُمْ فَاصْبِرُوا، وَاعْلَمُوا أَنَّ الْجَنَّةَ تَحْتَ ظِلاَلِ السُّيُوفِ، ثُمَّ قَالَ اللَّهُمَّ مُنْزِلَ الْكِتَابِ وَمُجْرِيَ السَّحَابِ وَهَازِمَ الأَحْزَابِ، اهْزِمْهُمْ وَانْصُرْنَا عَلَيْهِمْ ‏" ‏‏.‏

sunnah.com