كتاب المناقب
Virtues and Merits of the Prophet (pbuh) and his Companions
Sahih al-Bukhari 3646

Narrated Abu Huraira:

The Prophet (ﷺ) said, "A horse may be kept for one of three purposes: for a man it may be a source of reward; for another it may be a means of living; and for a third it may be a burden (a source of committing sins). As for the one for whom it is a source of reward, he is the one who keeps his horse for the sake of Jihad in Allah's Cause; he ties it with a long rope on a pasture or in a garden. So whatever its rope allows it to eat, will be regarded as good rewardable deeds (for its owner). And if it breaks off its rope and jumps over one or two hillocks, even its dung will be considered amongst his good deeds. And if it passes by a river and drinks water from it, that will be considered as good deeds for his benefit) even if he has had no intention of watering it. A horse is a shelter for the one who keeps it so that he may earn his living honestly and takes it as a refuge to keep him from following illegal ways (of gaining money), and does not forget the rights of Allah (i.e. paying the Zakat and allowing others to use it for Allah's Sake). But a horse is a burden (and a source of committing sins for him who keeps it out of pride and pretense and with the intention of harming the Muslims." The Prophet (ﷺ) was asked about donkeys. He replied, "Nothing has been revealed to be concerning them except this comprehensive Verse (which covers everything) :--'Then whosoever has done good equal to the weight of an atom (or a small ant), Shall see it (its reward) And whosoever has done evil equal to the weight of an atom (or a small ) ant), Shall see it (Its punishment)." (99.7-8)

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ، عَنْ مَالِكٍ، عَنْ زَيْدِ بْنِ أَسْلَمَ، عَنْ أَبِي صَالِحٍ السَّمَّانِ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ الْخَيْلُ لِثَلاَثَةٍ لِرَجُلٍ أَجْرٌ، وَلِرَجُلٍ سِتْرٌ وَعَلَى رَجُلٍ وِزْرٌ‏.‏ فَأَمَّا الَّذِي لَهُ أَجْرٌ، فَرَجُلٌ رَبَطَهَا فِي سَبِيلِ اللَّهِ، فَأَطَالَ لَهَا فِي مَرْجٍ أَوْ رَوْضَةٍ، وَمَا أَصَابَتْ فِي طِيَلِهَا مِنَ الْمَرْجِ أَوِ الرَّوْضَةِ كَانَتْ لَهُ حَسَنَاتٍ، وَلَوْ أَنَّهَا قَطَعَتْ طِيَلَهَا، فَاسْتَنَّتْ شَرَفًا أَوْ شَرَفَيْنِ، كَانَتْ أَرْوَاثُهَا حَسَنَاتٍ لَهُ، وَلَوْ أَنَّهَا مَرَّتْ بِنَهْرٍ فَشَرِبَتْ، وَلَمْ يُرِدْ أَنْ يَسْقِيَهَا، كَانَ ذَلِكَ لَهُ حَسَنَاتٍ، وَرَجُلٌ رَبَطَهَا تَغَنِّيًا وَسِتْرًا وَتَعَفُّفًا، لَمْ يَنْسَ حَقَّ اللَّهِ فِي رِقَابِهَا وَظُهُورِهَا، فَهِيَ لَهُ كَذَلِكَ سِتْرٌ‏.‏ وَرَجُلٌ رَبَطَهَا فَخْرًا وَرِيَاءً، وَنِوَاءً لأَهْلِ الإِسْلاَمِ فَهْىَ وِزْرٌ‏.‏ وَسُئِلَ النَّبِيُّ صلى الله عليه وسلم عَنِ الْحُمُرِ فَقَالَ ‏"‏ مَا أُنْزِلَ عَلَىَّ فِيهَا إِلاَّ هَذِهِ الآيَةُ الْجَامِعَةُ الْفَاذَّةُ ‏{‏فَمَنْ يَعْمَلْ مِثْقَالَ ذَرَّةٍ خَيْرًا يَرَهُ * وَمَنْ يَعْمَلْ مِثْقَالَ ذَرَّةٍ شَرًّا يَرَهُ‏}
Reference : Sahih al-Bukhari 3646
In-book reference : Book 61, Hadith 149
USC-MSA web (English) reference : Vol. 4, Book 56, Hadith 839
  (deprecated numbering scheme)