The Prophet ﷺ said, "Loyalty belongs only to the one who freed the slave."
عن النبي ﷺ قال: إنما الولاء لمن أعتق.
Bukhari narrated it in the Book of Inheritance (6752) from Ismail bin Abdullah, who said, "Malik narrated to me, from Nafi, from Abdullah bin Umar," and he mentioned it.