Jeremiah 38:28; Jeremiah 32:2

28 And Jeremiah remained min the court of the guard until the day that Jerusalem was taken.

At that time the army of the king of Babylon was besieging Jerusalem, and Jeremiah the prophet pwas shut up in qthe court of the guard that was in the palace of the king of Judah.