كتاب الفتن وأشراط الساعة
54  
The Book of Tribulations and Portents of the Last Hour
(18)
Chapter: The Hour Will Not Begin Until A Man Passes By Another Man's Grave And Wishes That He Was In The Place Of The Deceased, Because Of Calamity
(18)
بَاب لَا تَقُومُ السَّاعَةُ حَتَّى يَمُرَّ الرَّجُلُ بِقَبْرِ الرَّجُلِ فَيَتَمَنَّى أَنْ يَكُونَ مَكَانَ الْمَيِّتِ مِنْ الْبَلَاءِ
Sahih Muslim 2918 b

Hammam b. Munabbih reported:

This is what Abu Huraira reported from Allah's messenger (ﷺ) and in this connection he reported so many hadith (and one of them was this): Allah's Messenger (ﷺ) said: Kisra would die and then there would be no Kisra after him. Qaisar would die and there would be no Qaisar after him, but you will distribute their treasures in the cause of Allah.
حَدَّثَنَا مُحَمَّدُ بْنُ رَافِعٍ، حَدَّثَنَا عَبْدُ الرَّزَّاقِ، حَدَّثَنَا مَعْمَرٌ، عَنْ هَمَّامِ بْنِ مُنَبِّهٍ، قَالَ هَذَا مَا حَدَّثَنَا أَبُو هُرَيْرَةَ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم ‏.‏ فَذَكَرَ أَحَادِيثَ مِنْهَا وَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ هَلَكَ كِسْرَى ثُمَّ لاَ يَكُونُ كِسْرَى بَعْدَهُ وَقَيْصَرُ لَيَهْلِكَنَّ ثُمَّ لاَ يَكُونُ قَيْصَرُ بَعْدَهُ وَلَتُقْسَمَنَّ كُنُوزُهُمَا فِي سَبِيلِ اللَّهِ ‏"‏ ‏.‏
Reference : Sahih Muslim 2918b
In-book reference : Book 54, Hadith 93
USC-MSA web (English) reference : Book 41, Hadith 6975
  (deprecated numbering scheme)