38:1 Now Shephatiah the son of Mattan, Gedaliah the son of Pashhur, Jucal the son of Shelemiah, and Pashhur the son of Malchiah heard the words that Jeremiah was saying to all the people, 2 “Thus says the Lord: He who stays in this city shall die by the sword, by famine, and by pestilence, but he who goes out to the Chaldeans shall live. He shall have his life as a prize of war, and live. 3 Thus says the Lord: This city shall surely be given into the hand of the army of the king of Babylon and be taken.” 4 Then the officials said to the king, “Let this man be put to death, for he is weakening the hands of the soldiers who are left in this city, and the hands of all the people, by speaking such words to them. For this man is not seeking the welfare of this people, but their harm.” 5 King Zedekiah said, “Behold, he is in your hands, for the king can do nothing against you.” 6 So they took Jeremiah and cast him into the cistern of Malchiah, the king's son, which was in the court of the guard, letting Jeremiah down by ropes. And there was no water in the cistern, but only mud, and Jeremiah sank in the mud.
7 When Ebed-melech the Ethiopian, a eunuch who was in the king's house, heard that they had put Jeremiah into the cistern—the king was sitting in the Benjamin Gate— 8 Ebed-melech went from the king's house and said to the king, 9 “My lord the king, these men have done evil in all that they did to Jeremiah the prophet by casting him into the cistern, and he will die there of hunger, for there is no bread left in the city.” 10 Then the king commanded Ebed-melech the Ethiopian, “Take thirty men with you from here, and lift Jeremiah the prophet out of the cistern before he dies.” 11 So Ebed-melech took the men with him and went to the house of the king, to a wardrobe in the storehouse, and took from there old rags and worn-out clothes, which he let down to Jeremiah in the cistern by ropes. 12 Then Ebed-melech the Ethiopian said to Jeremiah, “Put the rags and clothes between your armpits and the ropes.” Jeremiah did so. 13 Then they drew Jeremiah up with ropes and lifted him out of the cistern. And Jeremiah remained in the court of the guard.
14 King Zedekiah sent for Jeremiah the prophet and received him at the third entrance of the temple of the Lord. The king said to Jeremiah, “I will ask you a question; hide nothing from me.” 15 Jeremiah said to Zedekiah, “If I tell you, will you not surely put me to death? And if I give you counsel, you will not listen to me.” 16 Then King Zedekiah swore secretly to Jeremiah, “As the Lord lives, who made our souls, I will not put you to death or deliver you into the hand of these men who seek your life.”
17 Then Jeremiah said to Zedekiah, “Thus says the Lord, the God of hosts, the God of Israel: If you will surrender to the officials of the king of Babylon, then your life shall be spared, and this city shall not be burned with fire, and you and your house shall live. 18 But if you do not surrender to the officials of the king of Babylon, then this city shall be given into the hand of the Chaldeans, and they shall burn it with fire, and you shall not escape from their hand.” 19 King Zedekiah said to Jeremiah, “I am afraid of the Judeans who have deserted to the Chaldeans, lest I be handed over to them and they deal cruelly with me.” 20 Jeremiah said, “You shall not be given to them. Obey now the voice of the Lord in what I say to you, and it shall be well with you, and your life shall be spared. 21 But if you refuse to surrender, this is the vision which the Lord has shown to me: 22 Behold, all the women left in the house of the king of Judah were being led out to the officials of the king of Babylon and were saying,
“‘Your trusted friends have deceived you
and prevailed against you;
now that your feet are sunk in the mud,
they turn away from you.’
23 All your wives and your sons shall be led out to the Chaldeans, and you yourself shall not escape from their hand, but shall be seized by the king of Babylon, and this city shall be burned with fire.”
24 Then Zedekiah said to Jeremiah, “Let no one know of these words, and you shall not die. 25 If the officials hear that I have spoken with you and come to you and say to you, ‘Tell us what you said to the king and what the king said to you; hide nothing from us and we will not put you to death,’ 26 then you shall say to them, ‘I made a humble plea to the king that he would not send me back to the house of Jonathan to die there.’” 27 Then all the officials came to Jeremiah and asked him, and he answered them as the king had instructed him. So they stopped speaking with him, for the conversation had not been overheard. 28 And Jeremiah remained in the court of the guard until the day that Jerusalem was taken. (ESV)