Amr bin As reported,

I heard the Messenger of Allah ﷺ say openly, not secretly, "The family of so-and-so are not my allies. My ally is only Allah and the righteous believers."

Muslim 519

Sahih

حدثني أحمد بن حنبل حدثنا محمد بن جعفر حدثنا شعبة عن إسمعيل بن أبي خالد عن قيس

عن عمرو بن العاص قال

سمعت رسول الله ﷺ جهارا غير سر يقول ألا إن آل أبي يعني فلانا ليسوا لي بأولياء إنما وليي الله وصالح المؤمنين

مسلم 519صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Faith
Chapter
Loyalty to the believers, breaking ties with others, and disavowal of them
Numbering
Darussalam 519
Muslim 519