Well did he keep the Muslims away?
The Muslims weren’t really a problem yet ... in 782.
When Judah was practicing child sacrifice God used the Babylonians to fulfill their judgment. You know, the Babylon located in Iraq? Judah was invaded. Lamentations was written during that time. Today, there are only 6 nations that outlaw pre-born genocide.