Al-Baqarah 2:251
فَهَزَمُوهُم بِإِذْنِ اللَّهِ وَقَتَلَ دَاوُودُ جَالُوتَ وَآتَاهُ اللَّهُ الْمُلْكَ وَالْحِكْمَةَ وَعَلَّمَهُ مِمَّا يَشَاءُ ۗ وَلَوْلَا دَفْعُ اللَّهِ النَّاسَ بَعْضَهُم بِبَعْضٍ لَّفَسَدَتِ الْأَرْضُ وَلَٰكِنَّ اللَّهَ ذُو فَضْلٍ عَلَى الْعَالَمِينَ ٢٥١
Fahazamoohum biithni Allahi waqatala dawoodu jaloota waatahu Allahu almulka waalhikmata waAAallamahu mimma yashao walawla dafAAu Allahi alnnasa baAAdahum bibaAAdin lafasadati alardu walakinna Allaha thoo fadlin AAala alAAalameena
So they defeated them (the army of Jalut [Goliath]) by Allah’s command and Dawud (David) killed Jalut. And Allah granted (Dawud) sovereignty and wisdom, and taught him what He wished. If Allah had not removed one group (that puts into force tyranny and oppression and breaches peace) by means of another (who fights for the protection of human dignity, life on) earth would have been ruined. But Allah is Bountiful to all the worlds. (2:251)