Sayyiduna Hakim bin Hizam (may Allah be pleased with him) said: On the day of Badr, the Messenger of Allah (peace and blessings be upon him) gave an order, then he himself took a handful of pebbles, faced us, and threw them at us, and said: "May the faces be disfigured!" So we were defeated. Thereupon Allah, the Mighty and Majestic, revealed this verse: "And you did not throw when you threw, but it was Allah who threw" [Surah al-Anfal: 17].
Hadith Referenceالمعجم الكبير للطبراني / باب الحاء / 3115