The Messenger of Allah ﷺ said, "While a man was walking along a road, he became severely thirsty. He found a well, climbed down into it, drank, and came back out. Then he saw a dog panting and licking the moist earth out of thirst. The man said to himself, 'This dog is suffering from thirst just as I was.' So he went back down into the well, filled his leather sock with water, held it in his mouth, and climbed up. He gave the water to the dog. Allah was pleased with what he did and forgave him."The companions asked, "Messenger of Allah, do we receive a reward for showing kindness to animals?"He replied, "There is a reward for kindness to every living creature."
أن رسول الله ﷺ قال: بينما رجل يمشي بطريق، إذ اشتد عليه العطش، فوجد بئرا، فنزل فيها فشرب، وخرج، فإذا كلب يلهث، يأكل الثرى من العطش، فقال الرجل: لقد بلغ هذا الكلب من العطش مثل الذي بلغ مني، فنزل البئر، فملأ خفه، ثم أمسكه بفيه، حتى رقي، فسقى الكلب، فشكر الله له، فغفر له، فقالوا: يا رسول الله، وإن لنا في البهائم لأجرا؟ فقال: في كل كبد رطبة أجر.
Malik narrated it in "Description of the Prophet" ﷺ (23) from Sumayy, the freedman of Abu Bakr, from Abu Salih Samman, from Abu Hurairah, and he related it.Bukhari narrated it in "Musaqat" (2363), and Muslim in "Salam" (2244), both through the route of Malik, with the same wording.