Mishkat al-Masabih
The Offices of Commander and Qadi — Hadith #3538
عَن الحارِثِ الْأَشْعَرِيِّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ:
" آمُرُكُمْ بِخَمْسٍ: بِالْجَمَاعَةِ وَالسَّمْعِ وَالطَّاعَةِ وَالْهِجْرَةِ وَالْجِهَادِ فِي سَبِيلِ اللَّهِ وَإِنَّهُ مَنْ خَرَجَ مِنَ الْجَمَاعَةِ قِيدَ شِبْرٍ فَقَدْ خَلَعَ رِبْقَةَ الْإِسْلَامِ مِنْ عُنُقِهِ إِلَّا أَنْ يُرَاجِعَ وَمَنْ دَعَا بِدَعْوَى الْجَاهِلِيَّةِ فَهُوَ مِنْ جُثَى جَهَنَّمَ وَإِنْ صَامَ وَصَلَّى وَزَعَمَ أَنَّهُ مُسْلِمٌ ". رَوَاهُ أَحْمد وَالتِّرْمِذِيّ
to maintain the community, to listen, to obey, to emigrate, and to fight in God’s path. He who secedes from the community as much as a span has cast off the tie of Islam from his neck unless he returns, and he who summons to what the pre-Islamic people believed belongs to the assemblies of jahannam even if he fasts, prays, and asserts that he is a Muslim.”
Ahmad and Tirmidhi transmitted it.