Hadithcore
Sunan Abi Dawud, 4289
sahih· Al-Albani

Umm salamah reported the Prophet (ﷺ) as saying about the swallowing up an army by the earth. I asked:

How will a man who comes against his will (be swallowed up by the earth), Messenger of Allah ? He replied: All will be swallowed up, but each will be raised according to his intention on the Day of Resurrection.

حَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا جَرِيرٌ، عَنْ عَبْدِ الْعَزِيزِ بْنِ رُفَيْعٍ، عَنْ عُبَيْدِ اللَّهِ ابْنِ الْقِبْطِيَّةِ، عَنْ أُمِّ سَلَمَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم بِقِصَّةِ جَيْشِ الْخَسْفِ قُلْتُ يَا رَسُولَ اللَّهِ فَكَيْفَ بِمَنْ كَانَ كَارِهًا قَالَ ‏

‏ يُخْسَفُ بِهِمْ وَلَكِنْ يُبْعَثُ يَوْمَ الْقِيَامَةِ عَلَى نِيَّتِهِ ‏

‏ ‏.‏

References2 variants
In-Book Reference
Book 38, Hadith 11
English Reference
Book 37, Hadith 4276