2 Chronicles 35:20-23

ISV(i) 20 Pharaoh Neco and Josiah’s Death
Some time after all of this, after Josiah had finished preparing the Temple, King Neco of Egypt invaded Carchemish on the Euphrates River, and Josiah went out to fight him. 21 But he sent messengers to him, who asked him, “What do we have in common, King of Judah? I am not here today opposing you. I am fighting the dynasty that is fighting me, and God has ordered me to hurry. For your own good, stop interfering with God, who is with me, and he won’t destroy you!”
22 But Josiah wouldn’t turn around. In fact, he put on a disguise so he could fight Neco. He wouldn’t listen to what God told him through what Neco had to say, and as a result, Josiah came to attack Neco on the Megiddo plain. 23 Some archers shot King Josiah, and the king told his servants, “Take me away, because I’m badly wounded.”