Sayyiduna Hakim bin Hizam (may Allah be pleased with him) narrates: On the occasion of the Battle of Badr the Prophet (peace and blessings be upon him) gave the order, and he took a handful of pebbles. We (that is, the polytheists of Makkah) came before him, and the Prophet (peace and blessings be upon him) threw them and said: "May these faces be disfigured!" And we were routed. Concerning this, Allah Almighty revealed this verse: "When you threw the pebbles, it was not you who threw them, but Allah Almighty who threw them."
Al-Tabarani recorded it, and its chain is hasan (good).