Shephatiah, Mattan's son; Gedaliah, Pashhur's son; Jucal, Shelemiah's son; and Pashhur, Malchiah's son heard what Jeremiah had been telling the people:
The LORD proclaims: Whoever stays in this city will die by the sword, famine, and disease. But whoever surrenders to the Babylonians will live; yes, their lives will be spared.
The LORD proclaims: This city will certainly be handed over to the army of Babylon's king, who will capture it.
Then the officials said to the king: "This man must be put to death! By saying such things, he is discouraging the few remaining troops left in the city, as well as all the people. This man doesn't seek their welfare but their ruin!"
"He's in your hands," King Zedekiah said, "for the king can do nothing to stop you."
So they seized Jeremiah, threw him into the cistern of the royal prince Malchiah, within the prison quarters, and lowered him down by ropes. Now there wasn't any water in the cistern, only mud, and Jeremiah began to sink into the mud.
Ebed-melech the Cushite, a court official in the royal palace, got word that they had thrown Jeremiah into the cistern. Since the king was sitting at the Benjamin Gate,
Ebed-melech left the palace and said to the king:
"My master the king, these men have made a terrible mistake in treating the prophet Jeremiah the way they have; they have thrown him into the cistern where he will die of starvation, for there's no bread left in the city."
Then the king commanded Ebed-melech the Cushite, "Take thirty men from here and take Jeremiah the prophet out of the cistern before he dies."
So Ebed-melech took the men and returned to the palace, to an underground supply room, where he found some old rags and scraps of clothing. Ebed-melech lowered them down the cistern by the ropes
and called to Jeremiah, "Put these old rags and scraps of clothing under your arms and hold on to the ropes." When Jeremiah did this,
they pulled him up by the ropes and got him out of the cistern. After that Jeremiah remained in the prison quarters.
King Zedekiah ordered that the prophet Jeremiah be brought to him at the third entrance of the LORD's temple, where the king said to Jeremiah, "I want to ask you something, and don't hide anything from me."
Jeremiah replied, "If I do, you'll kill me! And if I tell you what to do, you won't listen to me!"
So King Zedekiah swore to Jeremiah behind closed doors, "As the LORD lives, who has given us this life, I won't put you to death and I won't hand you over to those who seek to kill you."
So Jeremiah said to Zedekiah: "The LORD of heavenly forces, the God of Israel, proclaims: If you surrender to the officers of the king of Babylon, you and your family will live, and this city will not be burned down.
If you don't surrender to the officers of the king of Babylon, the city will be handed over to the Babylonians, who will burn it down, and you won't escape from them."
King Zedekiah said to Jeremiah, "I'm afraid that I will fall into the hands of the Judeans who have defected to the Babylonians, and they will torture me."
"That won't happen," Jeremiah replied, “if you obey the LORD, whose message I bring. You will survive, and all will go well for you.
But if you refuse to surrender, this is what the LORD has shown me:
All the women left in the palace of the king of Judah will be led out to the officers of the king of Babylon. And they will say: ‘Your trusted friends have betrayed you; they have deceived you; now that your feet are stuck in the mud, they are nowhere to be found.'
"All your wives and children will be led out to the Babylonians, and you yourself won't escape from them. The king of Babylon will capture you, and this city will be burned down."
Zedekiah said to Jeremiah, "No one is to know about these matters or else you will die.
If the officials find out that we met, and they come and say to you, ‘Tell us what you said to the king. Don't hide anything from us; otherwise, we'll kill you. So what did the king say to you?'
you should say to them, ‘I was begging the king not to send me back to the house of Jonathan to die there.'"
Then all the officials approached Jeremiah to question him. And he responded exactly as the king had instructed him. So they stopped interrogating him because the conversation between the king and Jeremiah hadn't been overheard.
References for Jeremiah 38:27
Jeremiah remained in the prison quarters until Jerusalem was captured.