Abu Labid (may Allah have mercy on him) said: One day al-Hakam bin Ayyub (may Allah have mercy on him) sent out horses (for a race). We said: "If we go to Sayyiduna Anas bin Malik (may Allah be pleased with him), we will ask him." We asked Sayyiduna Anas bin Malik (may Allah be pleased with him): "Did you use to wager on horse races in the time of the Prophet (peace and blessings be upon him)?" He said: "Yes; indeed, the Prophet (peace and blessings be upon him) wagered on a horse that was called Subhah. That horse won the wager, and he (peace and blessings be upon him) was delighted by it and was pleased with it."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السبق والرمي / 19774