Hadithcore
Musnad Ahmad 3756
sahih

It was narrated from "Abdullah bin Mas'ood that

The Prophet (ﷺ) said: "Horses are of three types, horses that are for the Most Merciful, horses that are for man, and horses that are for the Shaitan. As for horses that are for the Most Merciful, they are the ones that are allocated for (jihad) for the sake of Allah; (their owner will be rewarded for) their food, dung and urine-and he mentioned whatever Allah willed. As for the horses that are for the Shaitan, they are those on which people gamble and bet. As for the horses that are for man, they are horses that a man keeps for breeding and they ward off poverty.”

References1 variant
Arabic/English book
Book 26, Hadith 3756