Mishkat al-Masabih 3694
Al-Harith al-Ash‘ari reported God's Messenger as saying, “I command you five things:
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.
عَن الحارِثِ الْأَشْعَرِيِّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: 
" آمُرُكُمْ بِخَمْسٍ: بِالْجَمَاعَةِ وَالسَّمْعِ وَالطَّاعَةِ وَالْهِجْرَةِ وَالْجِهَادِ فِي سَبِيلِ اللَّهِ وَإِنَّهُ مَنْ خَرَجَ مِنَ الْجَمَاعَةِ قِيدَ شِبْرٍ فَقَدْ خَلَعَ رِبْقَةَ الْإِسْلَامِ مِنْ عُنُقِهِ إِلَّا أَنْ يُرَاجِعَ وَمَنْ دَعَا بِدَعْوَى الْجَاهِلِيَّةِ فَهُوَ مِنْ جُثَى جَهَنَّمَ وَإِنْ صَامَ وَصَلَّى وَزَعَمَ أَنَّهُ مُسْلِمٌ ". رَوَاهُ أَحْمد وَالتِّرْمِذِيّ