Abdullah bin Amr bin As reported,

The Prophet ﷺ said, "Whoever pledges allegiance to a leader, giving him the clasp of his hand and the fruit of his heart, let him obey him to the best of his ability. If another comes to contest his authority, then strike the neck of the latter."I asked, "Did you yourself hear this from the Messenger of Allah ﷺ?"He replied, "My ears heard it and my heart retained it."I said, "This cousin of yours, Muawiya, orders us to do such and such."He answered, "Obey him in what constitutes obedience to Allah, and disobey him in what constitutes disobedience to Allah."

Abu Dawud 4248

Sahih

حدثنا مسدد حدثنا عيسى بن يونس حدثنا الأعمش عن زيد بن وهب عن عبد الرحمن بن عبد رب الكعبة

عن عبد الله بن عمرو

أن النبي ﷺ قال من بايع إماما فأعطاه صفقة يده وثمرة قلبه فليطعه ما استطاع فإن جاء آخر ينازعه فاضربوا رقبة الآخر قلت أنت سمعت هذا من رسول الله ﷺ قال سمعته أذناي ووعاه قلبي قلت هذا ابن عمك معاوية يأمرنا أن نفعل ونفعل قال أطعه في طاعة الله واعصه في معصية الله

أبو داود 4248صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Tribulations and battles
Chapter
Tribulations and their signs
Numbering
Darussalam 4248
Abu Dawud 4248