Jerusalem was then under siege from the Babylonian army, and Jeremiah was imprisoned in the courtyard of the guard in the royal palace.