Jeremiah 38:28

New International Version Bible (NIV)
And Jeremiah remained in the courtyard of the guard until the day Jerusalem was captured.

The Fall of Jerusalem

This is how Jerusalem was taken:

Read Jeremiah 38:28 in other translations