Sunan an-Nasa'i, Book 45, Hadith 49 (Nasa'i 4764)

It was narrated from Samurah that the Prophet of Allah said:

"Whoever castrates his slave, we will castrate him, and whoever mutilates his slave, we will mutilate him." This is the wording of Ibn Bashshar (one of the narrators).