Khabab bin Arat reported,

Khabab, who had witnessed Badr with the Messenger of Allah ﷺ, reported that he watched the Messenger of Allah ﷺ throughout the entire night until dawn. When the Messenger of Allah ﷺ concluded his prayer with the salutation, Khabab came to him and said, "Messenger of Allah, may my father and mother be sacrificed for you, you have prayed tonight a prayer the like of which I have never seen you pray before."The Messenger of Allah ﷺ replied, "Indeed, it was a prayer of hope and fear. I asked my Lord عز وجل in it for three things, and He granted me two and withheld one. I asked my Lord عز وجل not to destroy us by what He destroyed the nations before us, and He granted me that. I asked my Lord عز وجل not to let an enemy from outside our ranks prevail over us, and He granted me that. And I asked my Lord not to divide us into warring factions, but He withheld that from me."

Nasai 1639

Sahih

أخبرنا عمرو بن عثمان بن سعيد بن كثير قال حدثنا أبي وبقية قالا حدثنا ابن أبي حمزة قال حدثني الزهري قال أخبرني عبيد الله بن عبد الله بن الحارث بن نوفل

عن عبد الله بن خباب بن الأرت عن أبيه

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

النسائي 1639صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Night prayer and voluntary prayers of the day
Chapter
Revival of the night
Numbering
Darussalam 1639
Nasai 1639