At the same time the Scythians began to swarm over Media, and
Cyaxerxes was forced to return to his own country and defend it.
Cyaxerxes, being a wise as well as a great king, managed to buy off the barbarian Scythians and later actually trained them for service in his army, both as teachers of archery and as mercenaries.
In the meantime, the Assyrian successor of Ashurbanipal made the mistake that cost him his life and his empire. He appointed Nabopolassar, a Chaldean of ancient lineage and of enthusiastic patriotism for his age-old country. Nabopolassar immediately entered into an alliance with Cyaxerxes that had for its purpose the overthrow of Nineveh and the establishment of Babylonia as an independent state.
Nabopolassar declared himself king of Babylonia, to the great dismay of the Assyrian court. To seal his alliance with the Medes, a marriage was arranged between Amytis, Cyaxerxes' daughter, and Nebuchadrezzar, his son and Crown Prince.
Nineveh was attacked at the same time by the Babylonians and Medians in the year 608. The great capital was besieged for two years. So fierce was the vengeance wrought upon the city and its inhabitants by the united armies that when the capture was finally made both were completely blotted out. For many centuries not even the location of Nineveh could be found.
This occurred in the year 606. The end of Nineveh brought to a close the history of the great Assyrian power that had ruled so masterfully over the then known entire world. It also brought about a situation that had its direct effect upon the beginning of the end of the Kingdom of Judah.
In Egypt history was in the making. Psammetich I, a Libyan soldier, recognizing in the crumbling of Assyrian power his own opportunity, made himself master of the country and established a new dynasty in Egypt. His son and successor, Pharaoh Necho, grasped the chance given him by Nabopolassar's attack on Nineveh to win back the provinces along the Mediterranean, that had been Egyptian before they were conquered by Assyria.
Without further ado, therefore, Necho, with a great army, started north, to conquer all of Assyria that he could and add it to his own Empire. This meant an invasion of Judah.
King Josiah was by no means ready to sit still and fall helplessly from the frying pan into the fire, as it were. Once entirely free from Assyria, he intended to maintain his independence. At least, he was not going to allow Pharaoh Necho to slip the noose around his neck without a struggle. Josiah, therefore, organized his armies and went out to meet Necho. This was when the campaign against Nineveh began.
To the Pharaoh's great surprise, when he reached the plain of Megiddo, he was confronted by Josiah. Necho sent him word that he had no quarrel with Judah whatever; but Josiah could see nothing in the future but the sovereignty of Egypt over his dominions and was determined to retain his independence at all costs. So, the war was on.