Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates that the Prophet (peace and blessings be upon him) said: "Hand me a fistful of pebbles." I handed them to him, and he threw them toward the enemy, and the eyes of every one of the enemy were filled with pebbles. Regarding this, the verse was revealed: "When you threw the pebbles, it was not you who threw them; rather it was Allah who threw them."
Al-Tabarani recorded it in al-Mu'jam al-Awsat. Its chain contains Yahya bin Ya'la, who is da'if (weak).