Please turn to Zechariah 14. This is a prophecy of the Day of the Lord, and God says that He will gather nations - Gentiles - against Jerusalem because of her apostasy:
So, first God gathers the nations against Jerusalem, but later He fights against them. He uses terrible nations for His own ends, and He allows those enemies to do what is in their nature to do, but He does not allow them to escape judgment, either. And He is justified in all that He does. The question for us is whether we fear Him enough to accept His judgments, and whether we grieve as much over what causes God to hide His face as over the terrible effects when He does.