Muaz bin Jabal reported,

The Messenger of Allah ﷺ once led a prayer that he prolonged considerably. When he finished, we said, or they said, "Messenger of Allah, you prolonged the prayer today."He replied, "I performed a prayer of hope and fear. I asked Allah عز وجل for three things on behalf of my community. He granted me two and withheld one. I asked Him not to allow an enemy from outside their ranks to overpower them, and He granted me that. I asked Him not to destroy them by drowning, and He granted me that. And I asked Him not to make their violence fall among themselves, but He withheld this from me."

Ibn Majah 3951

Sahih

حدثنا محمد بن عبد الله بن نمير وعلي بن محمد قالا حدثنا أبو معاوية عن الأعمش عن رجاء الأنصاري عن عبد الله بن شداد بن الهاد

عن معاذ بن جبل قال

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

ابن ماجه 3951صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Tribulations
Chapter
What will come of tribulations
Numbering
Darussalam 3951
Ibn Majah 3951