The Messenger of Allah ﷺ ordered that dogs be killed, then he said, "What is the matter with them and dogs?" Then he permitted them to keep dogs for guarding crops and dogs for guarding the ayn. Bundar said, the ayn refers to the walled gardens of Madinah.
حدثنا محمد بن بشار حدثنا عثمان بن عمر ح و حدثنا محمد بن الوليد حدثنا محمد بن جعفر قالا حدثنا شعبة عن أبي التياح قال سمعت مطرفا
أن رسول الله ﷺ أمر بقتل الكلاب ثم قال ما لهم وللكلاب ثم رخص لهم في كلب الزرع وكلب العين قال بندار العين حيطان المدينة