Sahih al-Bukhari, Hadith 2371

Narrated Abu Huraira: Allah's Messenger said, "Keeping horses may be a source of reward to some (man), a shelter to another (i.e. means of earning one's living), or a burden to a third. He to whom the horse will be a source of reward is the one who keeps it in Allah's Cause (prepare it for holy battles) and ties it by a long rope in a pasture (or a garden). He will get a reward equal to what its long rope allows it to eat in the pasture or the garden, and if that horse breaks its rope and crosses one or two hills, then all its footsteps and its dung will be counted as good deeds for its owner; and if it passes by a river and drinks from it, then that will also be regarded as a good deed for its owner even if he has had no intention of watering it then. Horses are a shelter from poverty to the second person who keeps horses for earning his living so as not to ask others, and at the same time he gives Allah's right (i.e. rak`at) (from the wealth he earns through using them in trading etc.,) and does not overburden them. He who keeps horses just out of pride and for showing off and as a means of harming the Muslims, his horses will be a source of sins to him." When Allah's Messenger was asked about donkeys, he replied, "Nothing particular was revealed to me regarding them except the general unique verse which is applicable to everything: "Whoever does goodness equal to the weight of an atom (or small ant) shall see it (its reward) on the Day of Resurrection."

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ يُوسُفَ، أَخْبَرَنَا مَالِكُ بْنُ أَنَسٍ، عَنْ زَيْدِ بْنِ أَسْلَمَ، عَنْ أَبِي صَالِحٍ السَّمَّانِ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏"‏ الْخَيْلُ لِرَجُلٍ أَجْرٌ، وَلِرَجُلٍ سِتْرٌ، وَعَلَى رَجُلٍ وِزْرٌ، فَأَمَّا الَّذِي لَهُ أَجْرٌ فَرَجُلٌ رَبَطَهَا فِي سَبِيلِ اللَّهِ، فَأَطَالَ بِهَا فِي مَرْجٍ أَوْ رَوْضَةٍ، فَمَا أَصَابَتْ فِي طِيَلِهَا ذَلِكَ مِنَ الْمَرْجِ أَوِ الرَّوْضَةِ كَانَتْ لَهُ حَسَنَاتٍ، وَلَوْ أَنَّهُ انْقَطَعَ طِيَلُهَا فَاسْتَنَّتْ شَرَفًا أَوْ شَرَفَيْنِ كَانَتْ آثَارُهَا وَأَرْوَاثُهَا حَسَنَاتٍ لَهُ، وَلَوْ أَنَّهَا مَرَّتْ بِنَهَرٍ فَشَرِبَتْ مِنْهُ وَلَمْ يُرِدْ أَنْ يَسْقِيَ كَانَ ذَلِكَ حَسَنَاتٍ لَهُ، فَهِيَ لِذَلِكَ أَجْرٌ، وَرَجُلٌ رَبَطَهَا تَغَنِّيًا وَتَعَفُّفًا ثُمَّ لَمْ يَنْسَ حَقَّ اللَّهِ فِي رِقَابِهَا وَلاَ ظُهُورِهَا، فَهِيَ لِذَلِكَ سِتْرٌ، وَرَجُلٌ رَبَطَهَا فَخْرًا وَرِيَاءً وَنِوَاءً لأَهْلِ الإِسْلاَمِ، فَهِيَ عَلَى ذَلِكَ وِزْرٌ ‏"‏‏.‏ وَسُئِلَ رَسُولُ اللَّهِ صلى الله عليه وسلم عَنِ الْحُمُرِ فَقَالَ ‏"‏ مَا أُنْزِلَ عَلَىَّ فِيهَا شَىْءٌ إِلاَّ هَذِهِ الآيَةُ الْجَامِعَةُ الْفَاذَّةُ ‏{‏َمَنْ يَعْمَلْ مِثْقَالَ ذَرَّةٍ خَيْرًا يَرَهُ * وَمَنْ يَعْمَلْ مِثْقَالَ ذَرَّةٍ شَرًّا يَرَهُ ‏}‏‏"‏

sunnah.com