Harith al-Ashari reported that the Prophet ﷺ said, in a long hadith, "I command you with five things that Allah has commanded me with: listening and obeying, jihad, migration, and holding to the community. Whoever departs from the community by even a handspan has cast off the yoke of Islam from his neck unless he returns. And whoever calls with the call of the days of ignorance is among the kneeling crowds of Hell."A man asked, "Messenger of Allah, even if he prays and fasts?"He replied, "Even if he prays and fasts. So call by the call of Allah, who has named you Muslims, believers, the servants of Allah."
أن الحارث الأشعري حدثه: أن النبي ﷺ قال في حديث طويل: وأنا آمركم بخمس الله أمرني بهن: السمع والطاعة، والجهاد، والهجرة، والجماعة، فإن من فارق الجماعة قيد شبر فقد خلع ربقة الإسلام من عنقه إلا أن يراجع، ومن ادعى دعوى الجاهلية، فإنه من جثا جهنم. فقال رجل: يا رسول الله! وإن صلى وصام؟ قال: وإن صلى وصام، فادعوا بدعوى الله الذي سماكم المسلمين المؤمنين عباد الله.
Tirmidhi (2863), Ahmad (17170), Ibn Khuzayma (1895), and Ibn Hibban (6233) narrated it and graded it sahih, as did Hakim (1/421), all of them through routes from Yahya bin Abu Kathir, from Zayd bin Salam, that Abu Salam told him, and he related it.Tirmidhi said, "This is a hasan sahih gharib hadith. Muhammad bin Ismail (Bukhari) said, 'Harith Ashari was a companion, and he has other hadiths besides this one.'" He also said, "This is a hasan gharib hadith. Abu Salam's name was Mamtur, and Ali bin Mubarak narrated it from Yahya bin Abu Kathir."Hakim said, "It is sahih according to the criteria of the two sheikhs."