After Josiah had finished restoring the Temple, King Neco of Egypt led his army up from Egypt to do battle at Carchemish on the Euphrates River, and Josiah and his army marched out to fight him.
References for 2 Chronicles 35:20
But King Neco sent messengers to Josiah with this message: “What do you want with me, king of Judah? I have no quarrel with you today! I am on my way to fight another nation, and God has told me to hurry! Do not interfere with God, who is with me, or he will destroy you.”
But Josiah refused to listen to Neco, to whom God had indeed spoken, and he would not turn back. Instead, he disguised himself and led his army into battle on the plain of Megiddo.
But the enemy archers hit King Josiah with their arrows and wounded him. He cried out to his men, “Take me from the battle, for I am badly wounded!”
So they lifted Josiah out of his chariot and placed him in another chariot. Then they brought him back to Jerusalem, where he died. He was buried there in the royal cemetery. And all Judah and Jerusalem mourned for him.