Sayyiduna Abdullah bin Mughaffal (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) ordered that dogs be killed, then later he said: "What have I to do with dogs?" So he (peace and blessings be upon him) gave permission for the shepherds' dog and the hunting dog.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب البيوع / 11033