Thawban reported,

The Messenger of Allah ﷺ said, "Allah folded up the earth for me so that I saw its eastern and western horizons, and the dominion of my nation will reach what was folded up for me of it. I have been granted the two treasures, the red and the white. I asked my Lord for my nation that He not destroy them with a sweeping famine, and that He not give power over them to an enemy from outside themselves who would violate their sanctity. My Lord said, 'Muhammad, when I issue a decree, it cannot be reversed. I grant you for your nation that I will not destroy them with a sweeping famine, and that I will not give power over them to an enemy from outside themselves who would violate their sanctity, even if those from all its regions,' or He said, 'from between its regions, were to gather against them, until some of them destroy others and some of them take others captive.'"

Tirmidhi 2176

Sahih

حدثنا قتيبة حدثنا حماد بن زيد عن أيوب عن أبي قلابة عن أبي أسماء الرحبي

عن ثوبان قال

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

الترمذي 2176صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Tribulations
Chapter
Prophet ﷺ asking three times for his ummah
Numbering
Darussalam 2176
Tirmidhi 2176