After all of these things, when Josiah had finished restoring the temple, Egypt's King Neco marched against Carchemish by the Euphrates, and Josiah marched out against him.
References for 2 Chronicles 35:20
But Neco sent messengers to Josiah. "What do you want with me, king of Judah?" he asked. "I haven't come to attack you today. I'm after the dynasty that wars with me. God told me to hurry, and he is on my side. Get out of God's way, or he will destroy you."
But Josiah wouldn't turn back. Instead, he camouflaged himself in preparation for battle, refusing to listen to Neco's words from God's own mouth, and went to fight Neco on the plain of Megiddo.
When archers shot King Josiah, he said to his servants, "Take me away; I'm badly wounded!"
So his servants took him out of his chariot, placed him in another one, and brought him to Jerusalem, where he died and was buried in the tombs of his ancestors. All Judah and Jerusalem mourned for Josiah.