Arfaja reported,

I heard the Messenger of Allah ﷺ say, "There will be troubles and disturbances. Whoever seeks to divide the affairs of this community while it stands united, strike him with the sword, whoever he may be."In another wording, "I saw the Prophet ﷺ on the pulpit addressing the people. He said, 'After me there will be troubles and disturbances. Whomever you see breaking away from the united body, or seeking to divide the affairs of Muhammad's ﷺ community, kill him, whoever he may be. For the hand of Allah is over the united body, and Satan runs alongside whoever departs from it.'"

Azami 7676

Sahih

عن عرفجة قال

سمعت رسول الله ﷺ يقول: إنه ستكون هنات وهنات فمن أراد أن يفرق أمر هذه الأمة، وهي جميع، فاضربوه بالسيف كائنا من كان. وفي لفظ: رأيت النبي ﷺ على المنبر يخطب الناس، فقال: إنه سيكون بعدي هنات وهنات، فمن رأيتموه فارق الجماعة، أو يريد يفرق أمر أمة محمد ﷺ كائنا من كان، فاقتلوه؛ فإن يد الله على الجماعة، فإن الشيطان مع من فارق الجماعة يركض.

الأعظمي 7676صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Leadership
Section
Command to kill whoever rebels against the imam and the Muslim community
Numbering
Jami al-Kamil 7676 (2nd edition)
Azami 7676