I heard the Prophet ﷺ say, "There will be turmoil and discord. Whoever tries to divide the affairs of the Muslims while they are united, strike him with the sword, whoever he may be."
حدثنا يحيى عن شعبة حدثني زياد بن علاقة
سمعت النبي ﷺ يقول تكون هنات وهنات فمن أراد أن يفرق أمر المسلمين وهم جميع فاضربوه بالسيف كائنا من كان
Its isnad is sahih, its narrators being reliable and well known. The hadith was narrated by Muslim, 3/1479, no. 1852, in the book of leadership, the chapter on the ruling on one who splits the affairs of the Muslims, and by Abu Dawud, 4/242, no. 4762, in the book of sunnah, the chapter on killing the Khawarij, and by Nasai, 7/92, no. 4020, in the book on the prohibition of bloodshed, the chapter on killing one who separates from the community.