(10) بَاب الْأَمْرِ بِقَتْلِ الْكِلَابِ وَبَيَانِ نَسْخِهِ وَبَيَانِ تَحْرِيمِ اقْتِنَائِهَا إِلَّا لِصَيْدٍ أَوْ زَرْعٍ أَوْ مَاشِيَةٍ وَنَحْوِ ذَلِكَ
Abu Zubair heard Jabir b. 'Abdullah (Allah be pleased with him) saying:
Allah's Messenger (ﷺ) ordered us to kill dogs, and we carried out this order so much so that we also kill the dog coming with a woman from the desert. Then Allah's Apostle (ﷺ) forbade their killing. He (the Prophet further) said: It is your duty the jet-black (dog) having two spots (on the eyes), for it is a devil.
Reference: Sahih Muslim 1572
In-book reference: Book 22, Hadith 59
USC-MSA web (English) reference(deprecated numbering scheme): Book 10, Hadith 3813