When the Assyrian capital Ninevah was overrun by the Babylonians in 612 BC, they moved their capital to Harran. Harran was captured by the Babylonians in 610 BC, and the capital was moved to Carchemish. Egypt was allied with the Assyrians, and marched in 609 BC. to their aide against the Babylonians.
The Egyptian army of Pharaoh Necho was delayed at Megiddo by the forces of King Josiah. Josiah was killed and his army was defeated.
The Egyptians were further delayed, so that when they met the full might of the Babylonian army led by Nebuchadnezzar II, in 605 BC, the combined Egyptian and Assyrian forces were soundly defeated. Assyria ceased to exist and Egypt retreated, and was never again a dominant force in the Middle East.