From the late 10th to the late seventh century 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 Babylonian ruler Nabopolassar, as well as the fellow Iranian Scythians and Cimmerians, and together they attacked the Assyrian Empire. The civil war ravaged the Assyrian Empire between 616 and 605 BC, thus freeing their respective peoples from three centuries of Assyrian rule. The unification of the Median tribes under king Deioces in 728 BC led to the foundation of the Median Empire which, by 612 BC, controlled almost the entire territory of present-day Iran and eastern Anatolia. This marked the end of the Kingdom of Urartu as well, which was subsequently conquered and dissolved.