Sunan Ibn Majah, Book 36, Hadith 140 (Ibn Majah 4068)

It was narrated that Umm Salamah said:

“The Prophet (ﷺ) mentioned the army that would be swallowed up by the earth, and Umm Salamah said: ‘O Messenger of Allah, perhaps there will be some among them who were forced (to join them)?’ He said: ‘They will be resurrected according to their intentions.’”