The Messenger of Allah ﷺ said, "The protection granted by Muslims is one. Whoever betrays a Muslim's pledge of safety, upon him is the curse of Allah, the angels, and all people. No obligatory or voluntary worship will be accepted from him."
قال رسول الله ﷺ: ذمة المسلمين واحدة، فمن أخفر مسلما فعليه لعنة الله والملائكة والناس أجمعين. لا يقبل منه صرف ولا عدل.
Bukhari narrated it in the Hajj chapter (1870), and Muslim in the Hajj chapter (1370), both from the hadith of Amash, from Ibrahim Taymi, from his father, from Ali bin Abu Talib, as mentioned. The wording given is Bukhari's, while Muslim's wording is, "No exchange and no ransom will be accepted from him on the Day of Resurrection."The word "akhfara" means to violate a Muslim's guarantee of protection given to a disbeliever. It is said, "akhfartu the man," when you break his covenant, and "khafartuhu" when you grant him protection.The hadith of Abu Hurairah was mentioned shortly before.