The dungeon - The cistern. Every house in Jerusalem was supplied with a subterranean cistern, so well constructed that the city never suffered in a siege from want of water. So large were they that when dry they seem to have been used for prisons Zechariah 9:11.
Hammelech - See Jeremiah 36:26 note.
The prison - The guard. They threw Jeremiah into the nearest cistern, intending that he should die of starvation. Some have thought that Psalms 69 was composed by Jeremiah when in this cistern.