The Messenger of Allah ﷺ said, "Do not harm a Muslim by insulting a disbeliever."
قال رسول الله ﷺ: لا تؤذوا مسلما بشتم كافر.
No references are available.
Narrated by Hakim (1/385) - and from him Bayhaqi in Shuab (6253) - from Ali bin Ahmad bin Qarqub Tammar, who said, Ibrahim bin Husayn (that is, Ibn Dizil) narrated to us, who said, Abu Yaman (that is, Hakam bin Nafi Bahrani) narrated to us, who said, Shuayb bin Abu Hamza informed me, from Abdullah bin Abdul-Rahman bin Abu Husayn, who said, Nawfal bin Masahiq narrated to me, from Saeed bin Zayd, who said, and then he related it.Hakim said, "This is a hadith sahih in isnad, though the two of them (Bukhari and Muslim) did not include it."Its isnad is hasan on account of Hakim's teacher. Dhahabi gave his biography in Tarikh Islam (25/470) and mentioned that a large number of people transmitted from him and that he had traveled widely seeking knowledge, which means he was known and reliable. His student, Abu Abdullah Hakim, graded his hadith as sahih, and the student knows best the standing of his teacher.Some scholars of knowledge have mentioned, regarding the reason for this hadith, that the Prophet ﷺ said it when Ikrima bin Abu Jahl complained to him that whenever he passed through Madinah, people would say of him, "This is the son of the enemy of Allah." So the Prophet stood up to deliver a speech and said what has been related.