Mishkat al-Masabih 1902
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «غُفِرَ لِامْرَأَةٍ مُومِسَةٍ مَرَّتْ بِكَلْبٍ عَلَى رَأْسِ رَكِيٍّ يَلْهَثُ كَادَ يَقْتُلُهُ الْعَطَشُ فَنَزَعَتْ خُفَّهَا فَأَوْثَقَتْهُ بِخِمَارِهَا فَنَزَعَتْ لَهُ مِنَ الْمَاءِ فَغُفِرَ لَهَا بِذَلِكَ» . قِيلَ: إِنَّ لَنَا فِي الْبَهَائِمِ أَجْرًا؟ قَالَ: «فِي كُلِّ ذَاتِ كبد رطبَة أجر»
From Abu Hurayrah, may Allah be pleased with him, who said: The Messenger of Allah ﷺ said: "A prostitute was forgiven. She passed by a dog at the edge of a well, panting; thirst had almost killed it. She took off her leather sock, tied it with her head-covering and drew up some water for it, and she was forgiven because of that." It was said: "Is there a reward for us in [serving] animals?" He said: "In every creature with a moist liver there is a reward."