From the late 10th to late 7th centuries BC, the Iranian peoples, together with the pre-Iranian kingdoms, fell under the domination of the Assyrian Empire, based in northern Mesopotamia. Under king Cyaxares, the Medes and Persians entered into an alliance with Nabopolassar of Babylon, as well as the Scythians and the Cimmerians, and together they attacked the Assyrian Empire. The civil war ravaged the Assyrian Empire between 616 BC and 605 BC, thus freeing their respective peoples from three centuries of Assyrian rule. The unification of the Median tribes under a single ruler in 728 BC led to the foundation of the Median Empire which, by 612 BC, controlled the whole Iran and the eastern Anatolia. This marked the end of the Kingdom of Urartu as well, which was subsequently conquered and dissolved.