Safiyyah was first allotted to Dihya Kalbi, then she came to belong to the Messenger of Allah ﷺ.
حدثنا مسدد حدثنا حماد بن زيد عن عبد العزيز بن صهيب
صارت صفية لدحية الكلبي ثم صارت لرسول الله ﷺ
[Its chain of transmission is sahih] Ibn Majah narrated it in the Book of Marriage, chapter titled "A Man Frees His Slave Woman and Then Marries Her," hadith no. 1957, from the hadith of Hammad bin Zayd, through this route.