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, and drank. When he came out, he saw a dog panting and licking the moist earth from thirst. The man said to himself, 'This dog has reached the same state of thirst that I had reached.' So he climbed back down into the well, filled his leather sock with water, held it in his mouth as he climbed up, and gave the dog to drink. Allah was grateful to him for that and forgave him."Someone asked, "Messenger of Allah, do we receive a reward for showing kindness to animals?"He replied, "There is a reward for showing kindness to every living creature."
حدثنا روح حدثنا مالك عن سمي عن أبي صالح
أن رسول الله ﷺ قال بينما رجل يمشي بطريق اشتد عليه العطش فوجد بئرا فنزل فيها فشرب ثم خرج فإذا كلب يلهث يأكل الثرى من العطش فقال الرجل لقد بلغ هذا الكلب من العطش مثل الذي بلغني فنزل البئر فملأ خفه ثم أمسكه بفيه حتى رقي فسقى الكلب فشكر الله عز وجل له فغفر له فقيل يا رسول الله إن لنا في البهائم لأجرا فقال في كل ذات كبد رطبة أجر
Its chain is sahih. Bukhari related it 8/11 in the book of manners, chapter on mercy to people and animals, Muslim 4/1761 no. 2244 in the book of greetings, chapter on the merit of watering animals, and Abu Dawud 2550 in the book of jihad, chapter on what is commanded regarding the care of animals.