Egypt was allied with the Assyrian king Ashur-uballit II, and marched in 609 BC to their aid against the Babylonians.
Necho king of Egypt came up to fight against Carchemish by the Euphrates River and that King Josiah was fatally wounded by an Egyptian archer. He was then brought back to Jerusalem to die. Necho is quoted as saying:
"What quarrel is there between you and me, O king of Judah? It is not you I am attacking at this time, but the house with which I am at war. God has told me to hurry; so stop opposing God, who is with me, or he will destroy you." (NIV)
However, at Carcemish in the summer of 605 BC (or 607 BC by some sources) an important battle was fought there by the Babylonian army of Nebuchadrezzar II and that of Pharaoh Necho II of Egypt (see the record contained in the Book of Jeremiah chapter 46 regarding Egypt and its defeat.). The aim of Necho's campaign was to contain the Westward advance of the Babylonian Empire and cut off its trade route across the Euphrates. However, the Egyptians were defeated by the unexpected attack of the Babylonians and were eventually expelled from Syria.
Assyria ceased to exist as an independent power.
Egypt retreated and was no longer a significant force in the Ancient Near East. Babylon controlled the territory up to the Wadi of Egypt and the Pharoah no longer left Egypt to exert any influence in the affairs of the region.
Jehoiakim (Hebrew: יהוֹיָקִים, "he whom Jehovah has set up", also sometimes spelled Jehoikim) (c. 634-598 BC, reign 609-598 BC) was king of Judah.