Falam taqtuloohum wa laakinnal laaha qatalahum; wa maa ramaita iz ramaita wa laakinnal laaha ramaa; wa liyubliyal mu'mineena minhu balaaa'an hasanaa; innal laaha Samee'un Aleem
So the fact is that it was not you, but it was Allah Who killed them; and it was not you when you threw [sand at them], but it was Allah Who threw it, (and the believers were employed for the task) that He might cause the believers to successfully pass through this test. Allah is All-Hearing, All-Knowing.